A registry for loaded symbols. More...
#include <SymbolRegistry.h>
Public Member Functions | |
SymbolRegistry () | |
Constructs a SymbolRegistry. More... | |
void | Clear () |
Clears the registry. More... | |
void | AddSymbol (const string &symbol, uint64_t vaddr) |
Adds a symbol to the registry. More... | |
string | LookupAddress (uint64_t vaddr, bool allowOffset) const |
Looks up an address. More... | |
Static Public Member Functions | |
static void | RunUnitTests (int &nSucceeded, int &nFailures) |
![]() | |
static void | RunUnitTests (int &nSucceeded, int &nFailures) |
Runs unit test cases. More... | |
A registry for loaded symbols.
Definition at line 39 of file SymbolRegistry.h.
SymbolRegistry::SymbolRegistry | ( | ) |
Constructs a SymbolRegistry.
Definition at line 31 of file SymbolRegistry.cc.
void SymbolRegistry::AddSymbol | ( | const string & | symbol, |
uint64_t | vaddr | ||
) |
Adds a symbol to the registry.
symbol | The symbol name. |
vaddr | The virtual address. |
Definition at line 42 of file SymbolRegistry.cc.
Referenced by LookupAddress().
void SymbolRegistry::Clear | ( | ) |
Clears the registry.
Definition at line 36 of file SymbolRegistry.cc.
Referenced by LookupAddress(), and CPUComponent::ResetState().
string SymbolRegistry::LookupAddress | ( | uint64_t | vaddr, |
bool | allowOffset | ||
) | const |
Looks up an address.
The returned address may be of the format "symbol+offset", where offset is a hexadecimal number, if allowOffset is true.
vaddr | The virtual address. |
allowOffset | If false, the address must be found exactly. If true, a symbol which almost matches the address, plus an offset, may be returned. |
Definition at line 48 of file SymbolRegistry.cc.
References AddSymbol(), UnitTest::Assert(), Clear(), if(), LookupAddress(), UNITTEST, and UNITTESTS.
Referenced by CPUDyntransComponent::DyntransToBeTranslatedDone(), CPUComponent::FunctionTraceCall(), LookupAddress(), I960_CPUComponent::ShowRegisters(), M88K_CPUComponent::ShowRegisters(), and CPUComponent::Unassemble().
|
static |