X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=cpu%2Fexetrace.cc;h=ff7e90c9ec670e79bb0be5a2a63584f469de9e41;hb=92533214b611cad77de99576867e6ed765cd5765;hp=0dd1d74d63f9005195d0bbf652799a0713cb3d8f;hpb=4a5dcc37bfb26c152c195061fa70c7aa246b5ca6;p=gem5.git diff --git a/cpu/exetrace.cc b/cpu/exetrace.cc index 0dd1d74d6..ff7e90c9e 100644 --- a/cpu/exetrace.cc +++ b/cpu/exetrace.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003 The Regents of The University of Michigan + * Copyright (c) 2001-2004 The Regents of The University of Michigan * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -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->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", PC - sym_addr); + outs << "@" << sym_str << " : "; + } + else { outs << "0x" << hex << PC << " : "; + } // // Print decoded instruction