gem5
v20.1.0.0
|
#include <symtab.hh>
Public Types | |
typedef std::shared_ptr< SymbolTable > | SymbolTablePtr |
typedef SymbolVector::iterator | iterator |
typedef SymbolVector::const_iterator | const_iterator |
Public Member Functions | |
const_iterator | begin () const |
const_iterator | end () const |
void | clear () |
bool | insert (const Symbol &symbol) |
bool | insert (const SymbolTable &other) |
bool | load (const std::string &file) |
bool | empty () const |
SymbolTablePtr | offset (Addr by) const |
SymbolTablePtr | mask (Addr m) const |
SymbolTablePtr | globals () const |
SymbolTablePtr | locals () const |
SymbolTablePtr | weaks () const |
void | serialize (const std::string &base, CheckpointOut &cp) const |
void | unserialize (const std::string &base, CheckpointIn &cp, Symbol::Binding default_binding=Symbol::Binding::Global) |
const_iterator | find (Addr address) const |
const_iterator | find (const std::string &name) const |
const_iterator | findNearest (Addr addr, Addr &nextaddr) const |
Find the nearest symbol equal to or less than the supplied address (e.g., the label for the enclosing function). More... | |
const_iterator | findNearest (Addr addr) const |
Overload for findNearestSymbol() for callers who don't care about nextaddr. More... | |
Private Types | |
typedef std::vector< Symbol > | SymbolVector |
typedef std::multimap< Addr, int > | AddrMap |
typedef std::map< std::string, int > | NameMap |
typedef std::function< void(SymbolTable &symtab, const Symbol &symbol)> | SymTabOp |
typedef std::function< bool(const Symbol &symbol)> | SymTabFilter |
Private Member Functions | |
bool | upperBound (Addr addr, AddrMap::const_iterator &iter) const |
SymbolTablePtr | operate (SymTabOp op) const |
SymbolTablePtr | filter (SymTabFilter filter) const |
SymbolTablePtr | filterByBinding (Symbol::Binding binding) const |
Private Attributes | |
SymbolVector | symbols |
AddrMap | addrMap |
NameMap | nameMap |
|
private |
typedef SymbolVector::const_iterator Loader::SymbolTable::const_iterator |
typedef SymbolVector::iterator Loader::SymbolTable::iterator |
|
private |
typedef std::shared_ptr<SymbolTable> Loader::SymbolTable::SymbolTablePtr |
|
private |
|
private |
|
private |
|
inline |
void Loader::SymbolTable::clear | ( | ) |
Definition at line 50 of file symtab.cc.
References clear(), and Stats::nameMap().
Referenced by clear().
|
inline |
|
inline |
Definition at line 126 of file symtab.hh.
References symbols.
Referenced by Workload::addFuncEvent(), find(), findNearest(), SparcISA::BranchDisp::generateDisassembly(), PowerISA::BranchPCRel::generateDisassembly(), PowerISA::BranchNonPCRel::generateDisassembly(), PowerISA::BranchPCRelCond::generateDisassembly(), PowerISA::BranchNonPCRelCond::generateDisassembly(), ArmISA::FsFreebsd::initState(), ArmISA::FsLinux::initState(), main(), ArmISA::ArmStaticInst::printMemSymbol(), ArmISA::ArmStaticInst::printTarget(), FunctionProfile::sample(), and BaseStackTrace::tryGetSymbol().
|
inlineprivate |
Definition at line 101 of file symtab.hh.
References insert(), and operate().
Referenced by filterByBinding().
|
inlineprivate |
|
inline |
Definition at line 181 of file symtab.hh.
References addrMap, end(), ArmISA::i, and symbols.
Referenced by Workload::addFuncEvent(), PowerISA::BranchPCRel::generateDisassembly(), PowerISA::BranchNonPCRel::generateDisassembly(), PowerISA::BranchPCRelCond::generateDisassembly(), PowerISA::BranchNonPCRelCond::generateDisassembly(), Linux::ThreadInfo::get_data(), ArmISA::FsFreebsd::initState(), ArmISA::FsLinux::initState(), main(), and BaseStackTrace::tryGetSymbol().
|
inline |
|
inline |
|
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. |
nextaddr | Address of following symbol (for determining valid range of symbol). |
A | const_iterator which points to the symbol if found, or end. |
Definition at line 209 of file symtab.hh.
References addr, addrMap, end(), ArmISA::i, symbols, and upperBound().
Referenced by SparcISA::BranchDisp::generateDisassembly(), ArmISA::ArmStaticInst::printMemSymbol(), ArmISA::ArmStaticInst::printTarget(), FunctionProfile::sample(), and BaseCPU::traceFunctionsInternal().
|
inline |
Definition at line 159 of file symtab.hh.
References filterByBinding(), and Loader::Symbol::Global.
Referenced by ArmISA::FsWorkload::FsWorkload(), ArmISA::FsFreebsd::initState(), and ArmISA::FsLinux::initState().
bool Loader::SymbolTable::insert | ( | const Symbol & | symbol | ) |
Definition at line 58 of file symtab.cc.
References Loader::Symbol::address, Loader::Symbol::name, and Stats::nameMap().
Referenced by PseudoInst::addsymbol(), Loader::ElfObject::ElfObject(), filter(), ArmISA::FsWorkload::FsWorkload(), ArmISA::FsFreebsd::initState(), ArmISA::FsLinux::initState(), AbstractMemory::initState(), RiscvISA::BareMetal::insertSymbol(), SparcISA::FsWorkload::insertSymbol(), KernelWorkload::insertSymbol(), KernelWorkload::KernelWorkload(), mask(), mmapFunc(), and offset().
bool Loader::SymbolTable::insert | ( | const SymbolTable & | other | ) |
Definition at line 78 of file symtab.cc.
References nameMap, and Stats::nameMap().
bool Loader::SymbolTable::load | ( | const std::string & | file | ) |
Definition at line 96 of file symtab.cc.
References addr, eat_white(), fatal, name(), and to_number().
Referenced by main().
|
inline |
Definition at line 165 of file symtab.hh.
References filterByBinding(), and Loader::Symbol::Local.
|
inline |
Definition at line 148 of file symtab.hh.
References Loader::Symbol::address, insert(), ArmISA::m, X86ISA::op, and operate().
|
inline |
Definition at line 137 of file symtab.hh.
References Loader::Symbol::address, insert(), X86ISA::op, and operate().
|
inlineprivate |
void Loader::SymbolTable::serialize | ( | const std::string & | base, |
CheckpointOut & | cp | ||
) | const |
Definition at line 136 of file symtab.cc.
References X86ISA::base, csprintf(), ArmISA::i, and paramOut().
Referenced by KernelWorkload::serialize().
void Loader::SymbolTable::unserialize | ( | const std::string & | base, |
CheckpointIn & | cp, | ||
Symbol::Binding | default_binding = Symbol::Binding::Global |
||
) |
Definition at line 150 of file symtab.cc.
References X86ISA::base, csprintf(), ArmISA::i, name(), optParamIn(), and paramIn().
Referenced by KernelWorkload::unserialize().
|
inlineprivate |
|
inline |
Definition at line 171 of file symtab.hh.
References filterByBinding(), and Loader::Symbol::Weak.
|
private |
Definition at line 72 of file symtab.hh.
Referenced by find(), findNearest(), and upperBound().
|
private |
|
private |