gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
SymbolTable Class Reference

#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 ATablegetAddrTable () const
 
const STablegetSymbolTable () 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
 

Detailed Description

Definition at line 42 of file symtab.hh.

Member Typedef Documentation

typedef std::multimap<Addr, std::string> SymbolTable::ATable

Definition at line 45 of file symtab.hh.

typedef std::map<std::string, Addr> SymbolTable::STable

Definition at line 46 of file symtab.hh.

Constructor & Destructor Documentation

SymbolTable::SymbolTable ( )
inline

Definition at line 67 of file symtab.hh.

SymbolTable::SymbolTable ( const std::string &  file)
inline

Definition at line 68 of file symtab.hh.

References load().

SymbolTable::~SymbolTable ( )
inline

Definition at line 69 of file symtab.hh.

Member Function Documentation

void SymbolTable::clear ( )

Definition at line 48 of file symtab.cc.

bool SymbolTable::findAddress ( const std::string &  symbol,
Addr address 
) const
inline
bool SymbolTable::findNearestAddr ( Addr  addr,
Addr symaddr,
Addr nextaddr 
) const
inline

Definition at line 147 of file symtab.hh.

References ArmISA::i, and upperBound().

Referenced by FunctionProfile::sample(), and AlphaISA::StackTrace::trace().

bool SymbolTable::findNearestAddr ( Addr  addr,
Addr symaddr 
) const
inline

Definition at line 160 of file symtab.hh.

References ArmISA::i, and upperBound().

bool SymbolTable::findNearestSymbol ( Addr  addr,
std::string &  symbol,
Addr symaddr,
Addr nextaddr 
) const
inline

Find the nearest symbol equal to or less than the supplied address (e.g., the label for the enclosing function).

Parameters
addrThe address to look up.
symbolReturn reference for symbol string.
symaddrReturn reference for symbol address.
nextaddrAddress of following symbol (for determining valid range of symbol).
Return values
Trueif 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().

bool SymbolTable::findNearestSymbol ( Addr  addr,
std::string &  symbol,
Addr symaddr 
) const
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().

bool SymbolTable::findSymbol ( Addr  address,
std::string &  symbol 
) const
inline
const ATable& SymbolTable::getAddrTable ( ) const
inline

Definition at line 75 of file symtab.hh.

References addrTable.

Referenced by main().

const STable& SymbolTable::getSymbolTable ( ) const
inline

Definition at line 76 of file symtab.hh.

References symbolTable.

bool SymbolTable::insert ( Addr  address,
std::string  symbol 
)
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
void SymbolTable::unserialize ( const std::string &  base,
CheckpointIn cp 
)
bool SymbolTable::upperBound ( Addr  addr,
ATable::const_iterator &  iter 
) const
inlineprivate

Definition at line 54 of file symtab.hh.

References addrTable.

Referenced by findNearestAddr(), and findNearestSymbol().

Member Data Documentation

ATable SymbolTable::addrTable
private

Definition at line 49 of file symtab.hh.

Referenced by findSymbol(), getAddrTable(), and upperBound().

STable SymbolTable::symbolTable
private

Definition at line 50 of file symtab.hh.

Referenced by findAddress(), and getSymbolTable().


The documentation for this class was generated from the following files:

Generated on Fri Jun 9 2017 13:04:20 for gem5 by doxygen 1.8.6