From 325a143d6fdf774f60c39643c3f4aa25e89457ba Mon Sep 17 00:00:00 2001 From: Ciro Santilli Date: Wed, 23 Sep 2020 19:54:53 +0100 Subject: [PATCH] cpu: make ExecSymbol show the symbol in addition to address 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 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- src/cpu/exetrace.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/cpu/exetrace.cc b/src/cpu/exetrace.cc index ca0504147..69ee5cc51 100644 --- a/src/cpu/exetrace.cc +++ b/src/cpu/exetrace.cc @@ -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()) { -- 2.30.2