gem5
|
#include <symtab.hh>
Public Types | |
typedef std::multimap< Addr, std::string > | ATable |
typedef std::map< std::string, Addr > | STable |
Public Member Functions | |
SymbolTable () | |
SymbolTable (const std::string &file) | |
~SymbolTable () | |
void | clear () |
bool | insert (Addr address, std::string symbol) |
bool | load (const std::string &file) |
const ATable & | getAddrTable () const |
const STable & | getSymbolTable () const |
void | serialize (const std::string &base, CheckpointOut &cp) const |
void | unserialize (const std::string &base, CheckpointIn &cp) |
bool | findSymbol (Addr address, std::string &symbol) const |
bool | findAddress (const std::string &symbol, Addr &address) const |
bool | findNearestSymbol (Addr addr, std::string &symbol, Addr &symaddr, Addr &nextaddr) const |
Find the nearest symbol equal to or less than the supplied address (e.g., the label for the enclosing function). More... | |
bool | findNearestSymbol (Addr addr, std::string &symbol, Addr &symaddr) const |
Overload for findNearestSymbol() for callers who don't care about nextaddr. More... | |
bool | findNearestAddr (Addr addr, Addr &symaddr, Addr &nextaddr) const |
bool | findNearestAddr (Addr addr, Addr &symaddr) const |
Private Member Functions | |
bool | upperBound (Addr addr, ATable::const_iterator &iter) const |
Private Attributes | |
ATable | addrTable |
STable | symbolTable |
typedef std::multimap<Addr, std::string> SymbolTable::ATable |
typedef std::map<std::string, Addr> SymbolTable::STable |
|
inline |
|
inline |
Definition at line 97 of file symtab.hh.
References ArmISA::i, and symbolTable.
Referenced by System::addFuncEvent(), Linux::ThreadInfo::get_data(), AlphaSystem::initState(), FreebsdArmSystem::initState(), LinuxArmSystem::initState(), LinuxAlphaSystem::initState(), main(), X86ISA::ProcessInfo::ProcessInfo(), AlphaISA::ProcessInfo::ProcessInfo(), ArmISA::ProcessInfo::ProcessInfo(), AlphaSystem::setAlphaAccess(), LinuxAlphaSystem::setDelayLoop(), and LinuxAlphaSystem::setupFuncEvents().
Definition at line 147 of file symtab.hh.
References ArmISA::i, and upperBound().
Referenced by FunctionProfile::sample(), and AlphaISA::StackTrace::trace().
Definition at line 160 of file symtab.hh.
References ArmISA::i, and upperBound().
|
inline |
Find the nearest symbol equal to or less than the supplied address (e.g., the label for the enclosing function).
addr | The address to look up. |
symbol | Return reference for symbol string. |
symaddr | Return reference for symbol address. |
nextaddr | Address of following symbol (for determining valid range of symbol). |
True | if a symbol was found. |
Definition at line 116 of file symtab.hh.
References ArmISA::i, and upperBound().
Referenced by ArmISA::ArmStaticInst::printMemSymbol(), ArmISA::ArmStaticInst::printTarget(), and Trace::ExeTracerRecord::traceInst().
|
inline |
Overload for findNearestSymbol() for callers who don't care about nextaddr.
Definition at line 133 of file symtab.hh.
References ArmISA::i, and upperBound().
|
inline |
Definition at line 84 of file symtab.hh.
References addrTable, and ArmISA::i.
Referenced by ProfileNode::dump(), FunctionProfile::dump(), PowerISA::BranchPCRel::generateDisassembly(), PowerISA::BranchNonPCRel::generateDisassembly(), PowerISA::BranchPCRelCond::generateDisassembly(), PowerISA::BranchNonPCRelCond::generateDisassembly(), and main().
|
inline |
|
inline |
Definition at line 76 of file symtab.hh.
References symbolTable.
bool SymbolTable::insert | ( | Addr | address, |
std::string | symbol | ||
) |
Definition at line 55 of file symtab.cc.
Referenced by PseudoInst::addsymbol(), EcoffObject::loadGlobalSymbols(), EcoffObject::loadLocalSymbols(), ElfObject::loadSomeSymbols(), and PseudoInst::loadsymbol().
bool SymbolTable::load | ( | const std::string & | file | ) |
Definition at line 72 of file symtab.cc.
References addr, eat_white(), fatal, and to_number().
Referenced by main(), and SymbolTable().
void SymbolTable::serialize | ( | const std::string & | base, |
CheckpointOut & | cp | ||
) | const |
Definition at line 113 of file symtab.cc.
References csprintf(), ArmISA::i, MipsISA::p, and paramOut().
Referenced by System::serialize(), SparcSystem::serializeSymtab(), and AlphaSystem::serializeSymtab().
void SymbolTable::unserialize | ( | const std::string & | base, |
CheckpointIn & | cp | ||
) |
Definition at line 127 of file symtab.cc.
References addr, ArmISA::clear(), csprintf(), ArmISA::i, paramIn(), and X86ISA::size().
Referenced by System::unserialize(), SparcSystem::unserializeSymtab(), and AlphaSystem::unserializeSymtab().
|
inlineprivate |
Definition at line 54 of file symtab.hh.
References addrTable.
Referenced by findNearestAddr(), and findNearestSymbol().
|
private |
Definition at line 49 of file symtab.hh.
Referenced by findSymbol(), getAddrTable(), and upperBound().
|
private |
Definition at line 50 of file symtab.hh.
Referenced by findAddress(), and getSymbolTable().