summaryrefslogtreecommitdiff
path: root/cpu
diff options
context:
space:
mode:
Diffstat (limited to 'cpu')
-rw-r--r--cpu/exetrace.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/cpu/exetrace.cc b/cpu/exetrace.cc
index 3e8877e93..4d3a70f37 100644
--- a/cpu/exetrace.cc
+++ b/cpu/exetrace.cc
@@ -48,11 +48,12 @@ using namespace std;
//
-const SymbolTable *debugSymbolTable = NULL;
+SymbolTable *debugSymbolTable = NULL;
void
Trace::InstRecord::dump(ostream &outs)
{
+
if (flags[PRINT_CYCLE])
ccprintf(outs, "%7d: ", cycle);
@@ -64,7 +65,16 @@ Trace::InstRecord::dump(ostream &outs)
if (flags[PRINT_THREAD_NUM])
outs << "T" << thread << " : ";
- outs << "0x" << hex << PC << " : ";
+
+ std::string str;
+ if(debugSymbolTable->findSymbol(PC, str))
+ outs << "@" << setw(17) << str << " : ";
+ else if(debugSymbolTable->findSymbol(PC - 4, str))
+ outs << "@" << setw(15) << str << "+4 : ";
+ else if(debugSymbolTable->findSymbol(PC - 8, str))
+ outs << "@" << setw(15) << str << "+8 : ";
+ else
+ outs << "0x" << hex << PC << " : ";
//
// Print decoded instruction