SymbolRegistry Class Reference

Back to the index.

Public Member Functions | Static Public Member Functions | List of all members
SymbolRegistry Class Reference

A registry for loaded symbols. More...

#include <SymbolRegistry.h>

Inheritance diagram for SymbolRegistry:
UnitTestable

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 Public Member Functions inherited from UnitTestable
static void RunUnitTests (int &nSucceeded, int &nFailures)
 Runs unit test cases. More...
 

Detailed Description

A registry for loaded symbols.

Definition at line 39 of file SymbolRegistry.h.

Constructor & Destructor Documentation

◆ SymbolRegistry()

SymbolRegistry::SymbolRegistry ( )

Constructs a SymbolRegistry.

Definition at line 31 of file SymbolRegistry.cc.

Member Function Documentation

◆ AddSymbol()

void SymbolRegistry::AddSymbol ( const string &  symbol,
uint64_t  vaddr 
)

Adds a symbol to the registry.

Parameters
symbolThe symbol name.
vaddrThe virtual address.

Definition at line 42 of file SymbolRegistry.cc.

◆ Clear()

void SymbolRegistry::Clear ( )

Clears the registry.

Definition at line 36 of file SymbolRegistry.cc.

Referenced by CPUComponent::ResetState().

◆ LookupAddress()

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.

Parameters
vaddrThe virtual address.
allowOffsetIf false, the address must be found exactly. If true, a symbol which almost matches the address, plus an offset, may be returned.
Returns
A string representing the address, or an empty string if no suitable match was found.

Definition at line 48 of file SymbolRegistry.cc.

Referenced by CPUDyntransComponent::DyntransToBeTranslatedDone(), CPUComponent::FunctionTraceCall(), I960_CPUComponent::ShowRegisters(), M88K_CPUComponent::ShowRegisters(), and CPUComponent::Unassemble().

◆ RunUnitTests()

static void SymbolRegistry::RunUnitTests ( int &  nSucceeded,
int &  nFailures 
)
static

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

Generated on Tue Mar 24 2020 14:04:48 for GXemul by doxygen 1.8.17