cpu: make ExecSymbol show the symbol in addition to address
authorCiro Santilli <ciro.santilli@arm.com>
Wed, 23 Sep 2020 18:54:53 +0000 (19:54 +0100)
committerCiro Santilli <ciro.santilli@arm.com>
Mon, 28 Sep 2020 10:47:38 +0000 (10:47 +0000)
Before this commit, ExecSymbol would show only the symbol and no address:

0: system.cpu: A0 T0 : @_kernel_flags_le_lo32+6    :   mrs   x0, currentel

After this commit, it shows the symbol in addition to the address:

0: system.cpu: A0 T0 : 0x10 @_kernel_flags_le_lo32+6    :   mrs   x0, currentel

Change-Id: I665802f50ce9aeac6bb9e174b5dd06196e757c60
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/35077
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/cpu/exetrace.cc

index ca050414720507479fea46f7b678707e98730307..69ee5cc514b85928402c27a3d15c72a31fea5918 100644 (file)
@@ -77,16 +77,15 @@ Trace::ExeTracerRecord::traceInst(const StaticInstPtr &inst, bool ran)
 
     Addr cur_pc = pc.instAddr();
     Loader::SymbolTable::const_iterator it;
+    ccprintf(outs, "%#x", cur_pc);
     if (Debug::ExecSymbol && (!FullSystem || !inUserMode(thread)) &&
             (it = Loader::debugSymbolTable.findNearest(cur_pc)) !=
                 Loader::debugSymbolTable.end()) {
         Addr delta = cur_pc - it->address;
         if (delta)
-            ccprintf(outs, "@%s+%d", it->name, delta);
+            ccprintf(outs, " @%s+%d", it->name, delta);
         else
-            ccprintf(outs, "@%s", it->name);
-    } else {
-        ccprintf(outs, "%#x", cur_pc);
+            ccprintf(outs, " @%s", it->name);
     }
 
     if (inst->isMicroop()) {