From c442a5ad806b6cccbb3ec4c5744b14b0c1f31a01 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Mon, 25 Feb 2019 00:17:46 -0800 Subject: 4987 - support `browse_trace` tool in SubX I've extracted it into a separate binary, independent of my Mu prototype. I also cleaned up my tracing layer to be a little nicer. Major improvements: - Realized that incremental tracing really ought to be the default. And to minimize printing traces to screen. - Finally figured out how to combine layers and call stack frames in a single dimension of depth. The answer: optimize for the experience of `browse_trace`. Instructions occupy a range of depths based on their call stack frame, and minor details of an instruction lie one level deeper in each case. Other than that, I spent some time adjusting levels everywhere to make `browse_trace` useful. --- subx/035labels.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'subx/035labels.cc') diff --git a/subx/035labels.cc b/subx/035labels.cc index e86441cf..4c5ea641 100644 --- a/subx/035labels.cc +++ b/subx/035labels.cc @@ -26,8 +26,8 @@ 05 0x0d0c0b0a/imm32 Entry: 05 0x0d0c0b0a/imm32 -+run: inst: 0x00000006 --run: inst: 0x00000001 ++run: 0x00000006 opcode: 05 +-run: 0x00000001 opcode: 05 :(before "End Globals") uint32_t Entry_address = 0; @@ -97,7 +97,7 @@ loop: Transform.push_back(rewrite_labels); :(code) void rewrite_labels(program& p) { - trace(99, "transform") << "-- rewrite labels" << end(); + trace(3, "transform") << "-- rewrite labels" << end(); if (p.segments.empty()) return; segment& code = p.segments.at(0); map byte_index; // values are unsigned, but we're going to do subtractions on them so they need to fit in 31 bits -- cgit 1.4.1-2-gfad0