class SymbolDataProvider

Defined at line 44 of file ../../src/developer/debug/zxdb/symbols/symbol_data_provider.h

This interface is how the debugger backend provides memory and register data to the symbol system

to evaluate expressions.

By default, this class returns no information. In this form it can be used to evaluate

expressions in contexts without a running process. To access data, most callers will want to use

the implementation associated with a frame or a process.

Registers are the most commonly accessed data type and they are often available synchronously. So

the interface provides a synchronous main register getter function and a fallback asynchronous

one. They are separated to avoid overhead of closure creation in the synchronous case, and to

avoid having a callback that's never issued.

This object is reference counted since evaluating a DWARF expression is asynchronous.

Public Methods

debug::Arch GetArch ()

Defined at line 53 of file ../../src/developer/debug/zxdb/symbols/symbol_data_provider.cc

fxl::RefPtr<SymbolDataProvider> GetEntryDataProvider ()

Returns a SymbolDataProvider that will retrieve register values from the entrypoint of the

current function.

Returns null if there is no entrypoint (like maybe there's no current function) or can't have

registers retrieved from it. This data provider is used to evaluate DW_OP_entry_value

expressions.

Defined at line 55 of file ../../src/developer/debug/zxdb/symbols/symbol_data_provider.cc

std::optional<cpp20::span<const uint8_t>> GetRegister (debug::RegisterID id)

Request for synchronous register data if possible.

If the value is not synchronously known, the return value will be std::nullopt. In this case,

GetRegisterAsync() should be called to retrieve the value.

The return value can be an empty view if the implementation knows synchronously that we don't

know the value. An example is an unsaved register in a non-topmost stack frame.

On successful data return, the data is owned by the implementor and should not be saved.

Defined at line 60 of file ../../src/developer/debug/zxdb/symbols/symbol_data_provider.cc

void GetRegisterAsync (debug::RegisterID id, GetRegisterCallback callback)

Request for register data with an asynchronous callback. The callback will be issued when the

register data is available.

Defined at line 64 of file ../../src/developer/debug/zxdb/symbols/symbol_data_provider.cc

void GetRegisters (const std::vector<debug::RegisterID> & regs, GetRegistersCallback cb)

A wrapper around GetRegister and GetRegisterAsync that collects all the requested register

values. The callback will be issued with all collected values. If all values are known

synchronously, the callback will be called reentrantly.

Defined at line 69 of file ../../src/developer/debug/zxdb/symbols/symbol_data_provider.cc

void WriteRegister (debug::RegisterID id, std::vector<uint8_t> data, WriteCallback cb)

Writes the given canonical register ID.

This must be a canonical register as identified by debug::RegisterInfo::canonical_id, which

means that it's a whole hardware register and needs no shifting nor masking.

Defined at line 103 of file ../../src/developer/debug/zxdb/symbols/symbol_data_provider.cc

std::optional<uint64_t> GetFrameBase ()

Synchronously returns the frame base pointer if possible. As with GetRegister, if this is not

available the implementation should call GetFrameBaseAsync().

The frame base is the DW_AT_frame_base for the current function. Often this will be the "base

pointer" register in the CPU, but could be other registers, especially if compiled without full

stack frames. Getting this value may involve evaluating another DWARF expression which may or

may not be asynchronous.

Defined at line 109 of file ../../src/developer/debug/zxdb/symbols/symbol_data_provider.cc

void GetFrameBaseAsync (GetFrameBaseCallback callback)

Asynchronous version of GetFrameBase.

Defined at line 111 of file ../../src/developer/debug/zxdb/symbols/symbol_data_provider.cc

uint64_t GetCanonicalFrameAddress ()

Returns the canonical frame address of the current frame. Returns 0 if it is not known. See

Frame::GetCanonicalFrameAddress().

Defined at line 116 of file ../../src/developer/debug/zxdb/symbols/symbol_data_provider.cc

std::optional<uint64_t> GetDebugAddressForContext (const SymbolContext & context)

Synchronously returns the debug address for a symbol context if available.

Defined at line 118 of file ../../src/developer/debug/zxdb/symbols/symbol_data_provider.cc

void GetTLSSegment (const SymbolContext & symbol_context, GetTLSSegmentCallback cb)

Get the address of the TLS segment for the given context. The TLS segment is where thread-local

variables live.

Defined at line 123 of file ../../src/developer/debug/zxdb/symbols/symbol_data_provider.cc

void GetMemoryAsync (uint64_t address, uint32_t size, GetMemoryCallback callback)

Request to retrieve a memory block from the debugged process. On success, the implementation

will call the callback with the retrieved data pointer.

It will read valid memory up to the maximum. It will do short reads if it encounters invalid

memory, so the result may be shorter than requested or empty (if the first byte is invalid).

Defined at line 128 of file ../../src/developer/debug/zxdb/symbols/symbol_data_provider.cc

void WriteMemory (uint64_t address, std::vector<uint8_t> data, WriteCallback cb)

Asynchronously writes to the given memory. The callback will be issued when the write is

complete.

Defined at line 133 of file ../../src/developer/debug/zxdb/symbols/symbol_data_provider.cc

void MakeFunctionCall (const struct FunctionCallInfo & call_info, FunctionCallCallback cb)

Call function |fn| in the current target. The callback will be issued when the thread

controller has determined that the function has returned (before the thread controller is

actually finished, see FinishPhysicalFrameThreadController). Which allows the callback to call

GetReturnValue to determine the returned type.

|fn| must be resolved to a concrete Function object before calling this function, see

ResolveFunction.

Defined at line 139 of file ../../src/developer/debug/zxdb/symbols/symbol_data_provider.cc

Protected Methods

void SymbolDataProvider ()

Defined at line 154 of file ../../src/developer/debug/zxdb/symbols/symbol_data_provider.h

void ~SymbolDataProvider ()

Defined at line 155 of file ../../src/developer/debug/zxdb/symbols/symbol_data_provider.h

Friends

class RefCountedThreadSafe
class MakeRefCountedHelper