summaryrefslogtreecommitdiff
path: root/cpu/exetrace.cc
diff options
context:
space:
mode:
Diffstat (limited to 'cpu/exetrace.cc')
-rw-r--r--cpu/exetrace.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/cpu/exetrace.cc b/cpu/exetrace.cc
index e31c3590c..58fb7d668 100644
--- a/cpu/exetrace.cc
+++ b/cpu/exetrace.cc
@@ -48,8 +48,6 @@ using namespace std;
//
-SymbolTable *debugSymbolTable = NULL;
-
void
Trace::InstRecord::dump(ostream &outs)
{
@@ -66,11 +64,17 @@ Trace::InstRecord::dump(ostream &outs)
outs << "T" << thread << " : ";
- std::string str;
- if ((debugSymbolTable) && (debugSymbolTable->findNearestSymbol(PC, str)))
- outs << "@" << setw(17) << str << " : ";
- else
+ std::string sym_str;
+ Addr sym_addr;
+ if (debugSymbolTable
+ && debugSymbolTable->findNearestSymbol(PC, sym_str, sym_addr)) {
+ if (PC != sym_addr)
+ sym_str += csprintf("+%d", addr - sym_addr);
+ outs << "@" << setw(17) << sym_str << " : ";
+ }
+ else {
outs << "0x" << hex << PC << " : ";
+ }
//
// Print decoded instruction