class Frame
Defined at line 31 of file ../../src/developer/debug/zxdb/client/frame.h
Represents one stack frame.
See also FrameFingerprint (the getter for a fingerprint is on Thread).
Public Methods
void Frame (Session * session)
Defined at line 9 of file ../../src/developer/debug/zxdb/client/frame.cc
void ~Frame ()
Defined at line 11 of file ../../src/developer/debug/zxdb/client/frame.cc
fxl::WeakPtr<Frame> GetWeakPtr ()
Defined at line 13 of file ../../src/developer/debug/zxdb/client/frame.cc
Thread * GetThread ()
Guaranteed non-null.
bool IsInline ()
Returns true if this is a synthetic stack frame for an inlined function. Inlined functions
don't have separate functions or stack pointers and are generated by the debugger based on the
symbols for a given location.
const Frame * GetPhysicalFrame ()
Returns the physical stack frame associated with the current frame. This is used to get the
non-inlined frame an inlined frame was expanded from. Non-inlined frames should return |this|.
const Location & GetLocation ()
Returns the location of the stack frame code. This will be symbolized.
uint64_t GetAddress ()
Returns the program counter of this frame. It should be the same as the address returned by
GetLocation().address().
debug_ipc::StackFrame::Trust GetTrust ()
Returns the Trust for this frame as reported by the unwinder. This indicates which specific
unwinder successfully unwound this frame.
const std::vector<debug::RegisterValue> * GetRegisterCategorySync (debug::RegisterCategory category)
Retrieves the registers of the given category that were saved with this stack frame. Only the
general registers are always available synchronously and on every stack frame.
Non-general registers can be retrieved for the top stack frame by querying asynchronously. Once
queried, they will be available synchronously from this function. If unfetched or the top stack
frame is non-topmost, this will return nullptr.
The general registers for non-topmost stack frames will be reconstructed by the unwinder.
Normally only a subset of them are avilable in that case (IP and SP, and some
architecture-dependant ones). The top stack frame will have all of them.
Inline frames will report the registers from the physical frame they're associated with.
void GetRegisterCategoryAsync (debug::RegisterCategory category, bool always_request, fit::function<void (const Err &, const std::vector<debug::RegisterValue> &)> cb)
Asynchronous version of GetRegisterCategorySync(). For topmost stack frames, things like vector
and floating-point registers can be queried from the agent with this function. The results will
be cached so will be available synchronously in the future via GetRegisterCategorySync().
The callback will always be issued. If the frame is destroyed before the registers are
retrieved, the error will be set and it will be called with an empty vector.
If |always_request| is set, the registers will always be requested even if there is an entry
in the cache. This is normally used for console commands such as "registers" that will always
want the most up to date data.
void WriteRegister (debug::RegisterID id, std::vector<uint8_t> data, fit::callback<void (const Err &)> cb)
Writes to the given register. The register must be a canonical hardware register.
This will fail if the current frame is not the top physical frame (otherwise it will clobber
the register for the top frame).
std::optional<uint64_t> GetBasePointer ()
The frame base pointer.
This is not necessarily the "BP" register. The symbols can specify an arbitrary frame base for
a location and this value will reflect that. If the base pointer is known-unknown, it will be
reported as 0 rather than nullopt (nullopt from GetBasePointer() indicates it needs an async
call).
In most cases the frame base is available synchronously (when it's in a register which is the
common case), but symbols can declare any DWARF expression to compute the frame base.
The synchronous version will return the base pointer if possible. If it returns no value, code
that can handle async calls can call the asynchronous version to be notified when the value is
available.
void GetBasePointerAsync (fit::callback<void (uint64_t)> cb)
uint64_t GetStackPointer ()
Returns the stack pointer at this location.
uint64_t GetCanonicalFrameAddress ()
The canonical frame address is the stack pointer immediately before calling into the current
frame. This will be 0 if unknown.
fxl::RefPtr<SymbolDataProvider> GetSymbolDataProvider ()
Returns the SymbolDataProvider that can be used to evaluate symbols in the context of this
frame.
fxl::RefPtr<EvalContext> GetEvalContext ()
Returns the EvalContext that can be used to evaluate expressions in the context of this frame.
bool IsAmbiguousInlineLocation ()
Determines if the code location this frame's address corresponds to is potentially ambiguous.
This happens when the instruction is the beginning of an inlined routine, and the address could
be considered either the imaginary call to the inlined routine, or its first code instruction.
See the Stack class declaration for more details about this case.