class MockModuleSymbols
Defined at line 19 of file ../../src/developer/debug/zxdb/symbols/mock_module_symbols.h
A mock for symbol lookup.
Public Methods
void AddSymbolLocations (const Identifier & name, std::vector<Location> locs)
Adds a mock mapping from the given name/address to the list of locations. The locations are
returned exactly as given so should be given in absolute addresses.
The identifier names here should be non-globally qualified (no leading "::"). This is because
when the list is queried against, input Identifiers will be looked up as normal and
non-globally qualified (if different). So to match everything, the underlying data needs to be
non-qualified.
The String variant does simple parsing based on "::" and is not template-aware. So anything
complex should use the Identifier variant.
The address variant takes absolute addresses. We don't do anything with ranges to find the
previous symbol, they should match exactly.
Defined at line 26 of file ../../src/developer/debug/zxdb/symbols/mock_module_symbols.cc
void AddSymbolLocations (const std::string & name, std::vector<Location> locs)
Defined at line 30 of file ../../src/developer/debug/zxdb/symbols/mock_module_symbols.cc
void AddSymbolLocations (uint64_t address, std::vector<Location> locs)
Defined at line 34 of file ../../src/developer/debug/zxdb/symbols/mock_module_symbols.cc
void AddLineDetails (uint64_t absolute_address, LineDetails details)
Adds a mock mapping from address to line details. This matches an exact address only, not a
range.
Defined at line 38 of file ../../src/developer/debug/zxdb/symbols/mock_module_symbols.cc
void AddSymbolRef (const IndexNode::SymbolRef & die, fxl::RefPtr<Symbol> symbol)
Injects a response to IndexSymbolRefToSymbol for resolving symbols from the index. See index()
getter.
Defined at line 42 of file ../../src/developer/debug/zxdb/symbols/mock_module_symbols.cc
void AddFileName (const std::string & file_name)
Adds a name to the list of files considered for FindFileMatches().
Defined at line 46 of file ../../src/developer/debug/zxdb/symbols/mock_module_symbols.cc
void AddDebugAddrEntry (uint64_t addr_base, uint64_t index, uint64_t value)
Adds a canned result for the query for the given offset in .debug_addr.
Defined at line 48 of file ../../src/developer/debug/zxdb/symbols/mock_module_symbols.cc
ModuleSymbolStatus GetStatus ()
ModuleSymbols implementation.
Defined at line 52 of file ../../src/developer/debug/zxdb/symbols/mock_module_symbols.cc
std::vector<Location> ResolveInputLocation (const SymbolContext & symbol_context, const InputLocation & input_location, const ResolveOptions & options)
Defined at line 61 of file ../../src/developer/debug/zxdb/symbols/mock_module_symbols.cc
FoundUnit GetDwarfUnitForAddress (const SymbolContext & symbol_context, uint64_t absolute_address)
Defined at line 107 of file ../../src/developer/debug/zxdb/symbols/mock_module_symbols.cc
LineDetails LineDetailsForAddress (const SymbolContext & symbol_context, uint64_t address, bool greedy)
Defined at line 112 of file ../../src/developer/debug/zxdb/symbols/mock_module_symbols.cc
std::vector<std::string> FindFileMatches (std::string_view name)
Defined at line 121 of file ../../src/developer/debug/zxdb/symbols/mock_module_symbols.cc
std::vector<fxl::RefPtr<Function>> GetMainFunctions ()
Defined at line 132 of file ../../src/developer/debug/zxdb/symbols/mock_module_symbols.cc
const Index & GetIndex ()
Defined at line 136 of file ../../src/developer/debug/zxdb/symbols/mock_module_symbols.cc
LazySymbol IndexSymbolRefToSymbol (const IndexNode::SymbolRef & )
Defined at line 138 of file ../../src/developer/debug/zxdb/symbols/mock_module_symbols.cc
bool HasBinary ()
Defined at line 145 of file ../../src/developer/debug/zxdb/symbols/mock_module_symbols.cc
std::optional<uint64_t> GetDebugAddrEntry (uint64_t addr_base, uint64_t index)
Defined at line 147 of file ../../src/developer/debug/zxdb/symbols/mock_module_symbols.cc
Index & index ()
Provides writable access to the index for tests to insert data. To hook up symbols, add them to
the index and call AddSymbolRef() with the same SymbolRef and the symbol you want it to resolve
to.
Defined at line 55 of file ../../src/developer/debug/zxdb/symbols/mock_module_symbols.h
void set_modification_time (std::size_t mtime)
Defined at line 57 of file ../../src/developer/debug/zxdb/symbols/mock_module_symbols.h
void set_mapped_length (uint64_t len)
Defined at line 58 of file ../../src/developer/debug/zxdb/symbols/mock_module_symbols.h
void set_build_dir (const std::string & build_dir)
Defined at line 59 of file ../../src/developer/debug/zxdb/symbols/mock_module_symbols.h
std::time_t GetModificationTime ()
Defined at line 63 of file ../../src/developer/debug/zxdb/symbols/mock_module_symbols.h
std::string GetBuildDir ()
Defined at line 64 of file ../../src/developer/debug/zxdb/symbols/mock_module_symbols.h
const SymbolFactory * GetSymbolFactory ()
Defined at line 65 of file ../../src/developer/debug/zxdb/symbols/mock_module_symbols.h
uint64_t GetMappedLength ()
Defined at line 66 of file ../../src/developer/debug/zxdb/symbols/mock_module_symbols.h
Protected Methods
void MockModuleSymbols (const std::string & local_file_name)
Defined at line 19 of file ../../src/developer/debug/zxdb/symbols/mock_module_symbols.cc
void MockModuleSymbols (const std::string & local_file_name, const std::string & build_id, bool loaded)
Defined at line 21 of file ../../src/developer/debug/zxdb/symbols/mock_module_symbols.cc
void ~MockModuleSymbols ()
Defined at line 24 of file ../../src/developer/debug/zxdb/symbols/mock_module_symbols.cc
Friends
class RefCountedThreadSafe
class MakeRefCountedHelper