Added code to print out the symbol if one exists for an address
cpu/exetrace.cc: added code to print out symbol if one is found for address kern/linux/linux_system.cc: added code to set the debugSymbolTable to the kernel symbol table --HG-- extra : convert_revision : 191d7608d04fa42baef5e618c0bbbf5ad4001031
This commit is contained in:
parent
60a1b35e4d
commit
a44248aab0
2 changed files with 11 additions and 2 deletions
|
@ -48,11 +48,12 @@ using namespace std;
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
const SymbolTable *debugSymbolTable = NULL;
|
SymbolTable *debugSymbolTable = NULL;
|
||||||
|
|
||||||
void
|
void
|
||||||
Trace::InstRecord::dump(ostream &outs)
|
Trace::InstRecord::dump(ostream &outs)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (flags[PRINT_CYCLE])
|
if (flags[PRINT_CYCLE])
|
||||||
ccprintf(outs, "%7d: ", cycle);
|
ccprintf(outs, "%7d: ", cycle);
|
||||||
|
|
||||||
|
@ -64,6 +65,11 @@ Trace::InstRecord::dump(ostream &outs)
|
||||||
if (flags[PRINT_THREAD_NUM])
|
if (flags[PRINT_THREAD_NUM])
|
||||||
outs << "T" << thread << " : ";
|
outs << "T" << thread << " : ";
|
||||||
|
|
||||||
|
|
||||||
|
std::string str;
|
||||||
|
if(debugSymbolTable->findSymbol(data.as_int, str))
|
||||||
|
outs << "@" << setw(17) << str << " : ";
|
||||||
|
else
|
||||||
outs << "0x" << hex << PC << " : ";
|
outs << "0x" << hex << PC << " : ";
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -41,6 +41,8 @@
|
||||||
#include "targetarch/isa_traits.hh"
|
#include "targetarch/isa_traits.hh"
|
||||||
#include "targetarch/vtophys.hh"
|
#include "targetarch/vtophys.hh"
|
||||||
|
|
||||||
|
extern SymbolTable *debugSymbolTable;
|
||||||
|
|
||||||
//un-comment this to see the state of call stack when it changes.
|
//un-comment this to see the state of call stack when it changes.
|
||||||
//#define SW_DEBUG
|
//#define SW_DEBUG
|
||||||
|
|
||||||
|
@ -71,6 +73,7 @@ LinuxSystem::LinuxSystem(const string _name, const uint64_t _init_param,
|
||||||
|
|
||||||
if (!kernel->loadGlobalSymbols(kernelSymtab))
|
if (!kernel->loadGlobalSymbols(kernelSymtab))
|
||||||
panic("could not load kernel symbols\n");
|
panic("could not load kernel symbols\n");
|
||||||
|
debugSymbolTable = kernelSymtab;
|
||||||
|
|
||||||
if (!console->loadGlobalSymbols(consoleSymtab))
|
if (!console->loadGlobalSymbols(consoleSymtab))
|
||||||
panic("could not load console symbols\n");
|
panic("could not load console symbols\n");
|
||||||
|
|
Loading…
Reference in a new issue