|
LLDB mainline
|
"lldb/Target/BorrowedStackFrame.h" More...
#include <BorrowedStackFrame.h>
Public Member Functions | |
| BorrowedStackFrame (lldb::StackFrameSP borrowed_frame_sp, uint32_t new_frame_index, std::optional< uint32_t > new_concrete_frame_index=std::nullopt) | |
| Construct a BorrowedStackFrame that wraps an existing frame. | |
| ~BorrowedStackFrame () override=default | |
| uint32_t | GetFrameIndex () const override |
| Query this frame to find what frame it is in this Thread's StackFrameList. | |
| void | SetFrameIndex (uint32_t index) |
| uint32_t | GetConcreteFrameIndex () override |
| Get the concrete frame index for this borrowed frame. | |
| StackID & | GetStackID () override |
| const Address & | GetFrameCodeAddress () override |
| Get an Address for the current pc value in this StackFrame. | |
| Address | GetFrameCodeAddressForSymbolication () override |
| Get the current code Address suitable for symbolication, may not be the same as GetFrameCodeAddress(). | |
| bool | ChangePC (lldb::addr_t pc) override |
| Change the pc value for a given thread. | |
| const SymbolContext & | GetSymbolContext (lldb::SymbolContextItem resolve_scope) override |
| Provide a SymbolContext for this StackFrame's current pc value. | |
| llvm::Error | GetFrameBaseValue (Scalar &value) override |
| Return the Canonical Frame Address (DWARF term) for this frame. | |
| DWARFExpressionList * | GetFrameBaseExpression (Status *error_ptr) override |
| Get the DWARFExpressionList corresponding to the Canonical Frame Address. | |
| Block * | GetFrameBlock () override |
| Get the current lexical scope block for this StackFrame, if possible. | |
| lldb::RegisterContextSP | GetRegisterContext () override |
| Get the RegisterContext for this frame, if possible. | |
| VariableList * | GetVariableList (bool get_file_globals, Status *error_ptr) override |
| Retrieve the list of variables whose scope either: | |
| lldb::VariableListSP | GetInScopeVariableList (bool get_file_globals, bool must_have_valid_location=false) override |
| Retrieve the list of variables that are in scope at this StackFrame's pc. | |
| lldb::ValueObjectSP | GetValueForVariableExpressionPath (llvm::StringRef var_expr, lldb::DynamicValueType use_dynamic, uint32_t options, lldb::VariableSP &var_sp, Status &error) override |
| Create a ValueObject for a variable name / pathname, possibly including simple dereference/child selection syntax. | |
| bool | HasDebugInformation () override |
| Determine whether this StackFrame has debug information available or not. | |
| const char * | Disassemble () override |
| Return the disassembly for the instructions of this StackFrame's function as a single C string. | |
| lldb::ValueObjectSP | GetValueObjectForFrameVariable (const lldb::VariableSP &variable_sp, lldb::DynamicValueType use_dynamic) override |
| Create a ValueObject for a given Variable in this StackFrame. | |
| bool | IsInlined () override |
| Query whether this frame is a concrete frame on the call stack, or if it is an inlined frame derived from the debug information and presented by the debugger. | |
| bool | IsSynthetic () const override |
| Query whether this frame is synthetic. | |
| bool | IsHistorical () const override |
| Query whether this frame is part of a historical backtrace. | |
| bool | IsArtificial () const override |
| Query whether this frame is artificial (e.g a synthesized result of inferring missing tail call frames from a backtrace). | |
| bool | IsHidden () override |
| Query whether this frame should be hidden from backtraces. | |
| const char * | GetFunctionName () override |
| Get the frame's demangled name. | |
| const char * | GetDisplayFunctionName () override |
| Get the frame's demangled display name. | |
| lldb::ValueObjectSP | FindVariable (ConstString name) override |
| Attempt to reconstruct the ValueObject for a variable with a given name from within the current StackFrame, within the current block. | |
| SourceLanguage | GetLanguage () override |
| Query this frame to determine what the default language should be when parsing expressions given the execution context. | |
| SourceLanguage | GuessLanguage () override |
| Similar to GetLanguage(), but is allowed to take a potentially incorrect guess if exact information is not available. | |
| lldb::ValueObjectSP | GuessValueForAddress (lldb::addr_t addr) override |
| Attempt to econstruct the ValueObject for a given raw address touched by the current instruction. | |
| lldb::ValueObjectSP | GuessValueForRegisterAndOffset (ConstString reg, int64_t offset) override |
| Attempt to reconstruct the ValueObject for the address contained in a given register plus an offset. | |
| StructuredData::ObjectSP | GetLanguageSpecificData () override |
| Language plugins can use this API to report language-specific runtime information about this compile unit, such as additional language version details or feature flags. | |
| lldb::RecognizedStackFrameSP | GetRecognizedFrame () override |
| lldb::StackFrameSP | GetBorrowedFrame () const |
| Get the underlying borrowed frame. | |
| bool | isA (const void *ClassID) const override |
| Public Member Functions inherited from lldb_private::StackFrame | |
| StackFrame (const lldb::ThreadSP &thread_sp, lldb::user_id_t frame_idx, lldb::user_id_t concrete_frame_idx, lldb::addr_t cfa, bool cfa_is_valid, lldb::addr_t pc, Kind frame_kind, bool artificial, bool behaves_like_zeroth_frame, const SymbolContext *sc_ptr) | |
| Construct a StackFrame object without supplying a RegisterContextSP. | |
| StackFrame (const lldb::ThreadSP &thread_sp, lldb::user_id_t frame_idx, lldb::user_id_t concrete_frame_idx, const lldb::RegisterContextSP ®_context_sp, lldb::addr_t cfa, lldb::addr_t pc, bool behaves_like_zeroth_frame, const SymbolContext *sc_ptr) | |
| StackFrame (const lldb::ThreadSP &thread_sp, lldb::user_id_t frame_idx, lldb::user_id_t concrete_frame_idx, const lldb::RegisterContextSP ®_context_sp, lldb::addr_t cfa, const Address &pc, bool behaves_like_zeroth_frame, const SymbolContext *sc_ptr) | |
| ~StackFrame () override | |
| lldb::ThreadSP | GetThread () const |
| const lldb::RegisterContextSP & | GetRegisterContextSP () const |
| virtual bool | DumpUsingFormat (Stream &strm, const lldb_private::FormatEntity::Entry *format, llvm::StringRef frame_marker={}) |
| Print a description of this frame using the provided frame format. | |
| virtual void | DumpUsingSettingsFormat (Stream *strm, bool show_unique=false, const char *frame_marker=nullptr) |
| Print a description for this frame using the frame-format formatter settings. | |
| virtual void | Dump (Stream *strm, bool show_frame_index, bool show_fullpaths) |
| Print a description for this frame using a default format. | |
| virtual bool | GetStatus (Stream &strm, bool show_frame_info, bool show_source, bool show_unique=false, const char *frame_marker=nullptr) |
| Print a description of this stack frame and/or the source context/assembly for this stack frame. | |
| void | SetFrameIndex (uint32_t index) |
| Set this frame's frame index. | |
| lldb::TargetSP | CalculateTarget () override |
| lldb::ProcessSP | CalculateProcess () override |
| lldb::ThreadSP | CalculateThread () override |
| lldb::StackFrameSP | CalculateStackFrame () override |
| void | CalculateExecutionContext (ExecutionContext &exe_ctx) override |
| Reconstruct the object's execution context into sc. | |
| virtual lldb::StackFrameListSP | GetContainingStackFrameList () const |
| Get the StackFrameList that contains this frame. | |
| Public Member Functions inherited from lldb_private::ExecutionContextScope | |
| virtual | ~ExecutionContextScope ()=default |
Static Public Member Functions | |
| static bool | classof (const StackFrame *obj) |
| static bool | classof (const StackFrame *obj) |
Private Member Functions | |
| BorrowedStackFrame (const BorrowedStackFrame &)=delete | |
| const BorrowedStackFrame & | operator= (const BorrowedStackFrame &)=delete |
Private Attributes | |
| lldb::StackFrameSP | m_borrowed_frame_sp |
| uint32_t | m_new_frame_index |
| uint32_t | m_new_concrete_frame_index |
Static Private Attributes | |
| static char | ID |
"lldb/Target/BorrowedStackFrame.h"
A wrapper around an existing StackFrame that supersedes its frame indices.
This class is useful when you need to present an existing stack frame with a different index, such as when creating synthetic frame views or renumbering frames without copying all the underlying data.
All methods delegate to the borrowed frame except for GetFrameIndex() & GetConcreteFrameIndex() which uses the overridden indices.
Definition at line 27 of file BorrowedStackFrame.h.
| BorrowedStackFrame::BorrowedStackFrame | ( | lldb::StackFrameSP | borrowed_frame_sp, |
| uint32_t | new_frame_index, | ||
| std::optional< uint32_t > | new_concrete_frame_index = std::nullopt ) |
Construct a BorrowedStackFrame that wraps an existing frame.
| [in] | borrowed_frame_sp | The existing StackFrame to borrow from. This frame's data will be used for all operations except frame index queries. |
| [in] | new_frame_index | The frame index to report instead of the borrowed frame's index. |
| [in] | new_concrete_frame_index | Optional concrete frame index. If not provided, defaults to new_frame_index. |
Definition at line 16 of file BorrowedStackFrame.cpp.
References GetConcreteFrameIndex(), lldb_private::StackFrame::GetRegisterContextSP(), GetStackID(), GetSymbolContext(), lldb_private::StackFrame::GetThread(), IsInlined(), LLDB_INVALID_FRAME_ID, lldb_private::StackFrame::m_behaves_like_zeroth_frame, m_borrowed_frame_sp, m_new_concrete_frame_index, m_new_frame_index, and lldb_private::StackFrame::StackFrame().
Referenced by BorrowedStackFrame(), and operator=().
|
overridedefault |
References error(), pc, and lldb_private::StackFrame::StackFrame().
|
privatedelete |
References BorrowedStackFrame().
|
overridevirtual |
Change the pc value for a given thread.
Change the current pc value for the frame on this thread.
| [in] | pc | The load address that the pc will be set to. |
Reimplemented from lldb_private::StackFrame.
Definition at line 62 of file BorrowedStackFrame.cpp.
References m_borrowed_frame_sp, and pc.
|
static |
Definition at line 185 of file BorrowedStackFrame.cpp.
References ID, lldb_private::StackFrame::isA(), and lldb_private::StackFrame::StackFrame().
|
overridevirtual |
Return the disassembly for the instructions of this StackFrame's function as a single C string.
Reimplemented from lldb_private::StackFrame.
Definition at line 111 of file BorrowedStackFrame.cpp.
References m_borrowed_frame_sp.
|
overridevirtual |
Attempt to reconstruct the ValueObject for a variable with a given name from within the current StackFrame, within the current block.
The search for the variable starts in the deepest block corresponding to the current PC in the stack frame and traverse through all parent blocks stopping at inlined function boundaries.
| [in] | name | The name of the variable. |
Reimplemented from lldb_private::StackFrame.
Definition at line 147 of file BorrowedStackFrame.cpp.
References m_borrowed_frame_sp.
| StackFrameSP BorrowedStackFrame::GetBorrowedFrame | ( | ) | const |
Get the underlying borrowed frame.
Definition at line 177 of file BorrowedStackFrame.cpp.
References m_borrowed_frame_sp.
|
overridevirtual |
Get the concrete frame index for this borrowed frame.
Returns the overridden concrete frame index provided at construction, or LLDB_INVALID_FRAME_ID if the borrowed frame represents an inlined function, since this would require some computation if we chain inlined borrowed stack frames.
Reimplemented from lldb_private::StackFrame.
Definition at line 42 of file BorrowedStackFrame.cpp.
References m_new_concrete_frame_index.
Referenced by BorrowedStackFrame().
|
overridevirtual |
Get the frame's demangled display name.
///
Reimplemented from lldb_private::StackFrame.
Definition at line 143 of file BorrowedStackFrame.cpp.
References m_borrowed_frame_sp.
|
overridevirtual |
Get the DWARFExpressionList corresponding to the Canonical Frame Address.
Often a register (bp), but sometimes a register + offset.
| [out] | error_ptr | If there is an error determining the CFA address, this may contain a string explaining the failure. |
Reimplemented from lldb_private::StackFrame.
Definition at line 76 of file BorrowedStackFrame.cpp.
References m_borrowed_frame_sp.
|
overridevirtual |
Return the Canonical Frame Address (DWARF term) for this frame.
The CFA is typically the value of the stack pointer register before the call invocation is made. It will not change during the lifetime of a stack frame. It is often not the same thing as the frame pointer register value.
Live StackFrames will always have a CFA but other types of frames may not be able to supply one.
| [out] | value | The address of the CFA for this frame, if available. |
Reimplemented from lldb_private::StackFrame.
Definition at line 71 of file BorrowedStackFrame.cpp.
References m_borrowed_frame_sp.
|
overridevirtual |
Get the current lexical scope block for this StackFrame, if possible.
If debug information is available for this stack frame, return a pointer to the innermost lexical Block that the frame is currently executing.
Reimplemented from lldb_private::StackFrame.
Definition at line 80 of file BorrowedStackFrame.cpp.
References m_borrowed_frame_sp.
|
overridevirtual |
Get an Address for the current pc value in this StackFrame.
May not be the same as the actual PC value for inlined stack frames.
Reimplemented from lldb_private::StackFrame.
Definition at line 54 of file BorrowedStackFrame.cpp.
References m_borrowed_frame_sp.
|
overridevirtual |
Get the current code Address suitable for symbolication, may not be the same as GetFrameCodeAddress().
For a frame in the middle of the stack, the return-pc is the current code address, but for symbolication purposes the return address after a noreturn call may point to the next function, a DWARF location list entry that is a completely different code path, or the wrong source line.
The address returned should be used for symbolication (source line, block, function, DWARF location entry selection) but should NOT be shown to the user. It may not point to an actual instruction boundary.
Reimplemented from lldb_private::StackFrame.
Definition at line 58 of file BorrowedStackFrame.cpp.
References m_borrowed_frame_sp.
|
overridevirtual |
Query this frame to find what frame it is in this Thread's StackFrameList.
Reimplemented from lldb_private::StackFrame.
Definition at line 36 of file BorrowedStackFrame.cpp.
References m_new_frame_index.
|
overridevirtual |
Get the frame's demangled name.
///
Reimplemented from lldb_private::StackFrame.
Definition at line 139 of file BorrowedStackFrame.cpp.
References m_borrowed_frame_sp.
|
overridevirtual |
Retrieve the list of variables that are in scope at this StackFrame's pc.
A frame that is not live may return an empty VariableListSP for a given pc value even though variables would be available at this point if it were a live stack frame.
| [in] | get_file_globals | Whether to also retrieve compilation-unit scoped variables that are visible to the entire compilation unit (e.g. file static in C, globals that are homed in this CU). |
| [in] | must_have_valid_location | Whether to filter variables whose location is not available at this StackFrame's pc. |
Reimplemented from lldb_private::StackFrame.
Definition at line 94 of file BorrowedStackFrame.cpp.
References m_borrowed_frame_sp.
|
overridevirtual |
Query this frame to determine what the default language should be when parsing expressions given the execution context.
Reimplemented from lldb_private::StackFrame.
Definition at line 151 of file BorrowedStackFrame.cpp.
References m_borrowed_frame_sp.
|
overridevirtual |
Language plugins can use this API to report language-specific runtime information about this compile unit, such as additional language version details or feature flags.
Reimplemented from lldb_private::StackFrame.
Definition at line 169 of file BorrowedStackFrame.cpp.
References m_borrowed_frame_sp.
|
overridevirtual |
Reimplemented from lldb_private::StackFrame.
Definition at line 173 of file BorrowedStackFrame.cpp.
References m_borrowed_frame_sp.
|
overridevirtual |
Get the RegisterContext for this frame, if possible.
Returns a shared pointer to the RegisterContext for this stack frame. Only a live StackFrame object will be able to return a RegisterContext - callers must be prepared for an empty shared pointer being returned.
Even a live StackFrame RegisterContext may not be able to provide all registers. Only the currently executing frame (frame 0) can reliably provide every register in the register context.
Reimplemented from lldb_private::StackFrame.
Definition at line 84 of file BorrowedStackFrame.cpp.
References m_borrowed_frame_sp.
|
overridevirtual |
Reimplemented from lldb_private::StackFrame.
Definition at line 50 of file BorrowedStackFrame.cpp.
References m_borrowed_frame_sp.
Referenced by BorrowedStackFrame().
|
overridevirtual |
Provide a SymbolContext for this StackFrame's current pc value.
The StackFrame maintains this SymbolContext and adds additional information to it on an as-needed basis. This helps to avoid different functions looking up symbolic information for a given pc value multiple times.
| [in] | resolve_scope | Flags from the SymbolContextItem enumerated type which specify what type of symbol context is needed by this caller. |
Reimplemented from lldb_private::StackFrame.
Definition at line 67 of file BorrowedStackFrame.cpp.
References m_borrowed_frame_sp.
Referenced by BorrowedStackFrame().
|
overridevirtual |
Create a ValueObject for a variable name / pathname, possibly including simple dereference/child selection syntax.
| [in] | var_expr | The string specifying a variable to base the VariableObject off of. |
| [in] | use_dynamic | Whether the correct dynamic type of an object pointer should be determined before creating the object, or if the static type is sufficient. One of the DynamicValueType enumerated values. |
| [in] | options | An unsigned integer of flags, values from StackFrame::ExpressionPathOption enum. |
| [in] | var_sp | A VariableSP that will be set to the variable described in the var_expr path. |
| [in] | error | Record any errors encountered while evaluating var_expr. |
Reimplemented from lldb_private::StackFrame.
Definition at line 100 of file BorrowedStackFrame.cpp.
References error(), and m_borrowed_frame_sp.
|
overridevirtual |
Create a ValueObject for a given Variable in this StackFrame.
| [in] | variable_sp | The Variable to base this ValueObject on |
| [in] | use_dynamic | Whether the correct dynamic type of the variable should be determined before creating the ValueObject, or if the static type is sufficient. One of the DynamicValueType enumerated values. |
Reimplemented from lldb_private::StackFrame.
Definition at line 115 of file BorrowedStackFrame.cpp.
References m_borrowed_frame_sp.
|
overridevirtual |
Retrieve the list of variables whose scope either:
A frame that is not live may return an empty VariableList for a given pc value even though variables would be available at this point if it were a live stack frame.
| [in] | get_file_globals | Whether to also retrieve compilation-unit scoped variables that are visible to the entire compilation unit (e.g. file static in C, globals that are homed in this CU). |
| [out] | error_ptr | If there is an error in the debug information that prevents variables from being fetched. |
Reimplemented from lldb_private::StackFrame.
Definition at line 88 of file BorrowedStackFrame.cpp.
References m_borrowed_frame_sp.
|
overridevirtual |
Similar to GetLanguage(), but is allowed to take a potentially incorrect guess if exact information is not available.
Reimplemented from lldb_private::StackFrame.
Definition at line 155 of file BorrowedStackFrame.cpp.
References m_borrowed_frame_sp.
|
overridevirtual |
Attempt to econstruct the ValueObject for a given raw address touched by the current instruction.
The ExpressionPath should indicate how to get to this value using "frame variable."
| [in] | addr | The raw address. |
Reimplemented from lldb_private::StackFrame.
Definition at line 159 of file BorrowedStackFrame.cpp.
References m_borrowed_frame_sp.
|
overridevirtual |
Attempt to reconstruct the ValueObject for the address contained in a given register plus an offset.
The ExpressionPath should indicate how to get to this value using "frame variable."
| [in] | reg | The name of the register. |
| [in] | offset | The offset from the register. Particularly important for sp... |
Reimplemented from lldb_private::StackFrame.
Definition at line 164 of file BorrowedStackFrame.cpp.
References m_borrowed_frame_sp.
|
overridevirtual |
Determine whether this StackFrame has debug information available or not.
Reimplemented from lldb_private::StackFrame.
Definition at line 107 of file BorrowedStackFrame.cpp.
References m_borrowed_frame_sp.
|
overridevirtual |
Reimplemented from lldb_private::StackFrame.
Definition at line 181 of file BorrowedStackFrame.cpp.
References ID, and lldb_private::StackFrame::isA().
|
overridevirtual |
Query whether this frame is artificial (e.g a synthesized result of inferring missing tail call frames from a backtrace).
Artificial frames may have limited support for inspecting variables.
Reimplemented from lldb_private::StackFrame.
Definition at line 133 of file BorrowedStackFrame.cpp.
References m_borrowed_frame_sp.
|
overridevirtual |
Query whether this frame should be hidden from backtraces.
Frame recognizers can customize this behavior and hide distracting system implementation details this way.
Reimplemented from lldb_private::StackFrame.
Definition at line 137 of file BorrowedStackFrame.cpp.
References m_borrowed_frame_sp.
|
overridevirtual |
Query whether this frame is part of a historical backtrace.
Reimplemented from lldb_private::StackFrame.
Definition at line 129 of file BorrowedStackFrame.cpp.
References m_borrowed_frame_sp.
|
overridevirtual |
Query whether this frame is a concrete frame on the call stack, or if it is an inlined frame derived from the debug information and presented by the debugger.
Reimplemented from lldb_private::StackFrame.
Definition at line 121 of file BorrowedStackFrame.cpp.
References m_borrowed_frame_sp.
Referenced by BorrowedStackFrame().
|
overridevirtual |
Query whether this frame is synthetic.
Reimplemented from lldb_private::StackFrame.
Definition at line 125 of file BorrowedStackFrame.cpp.
References m_borrowed_frame_sp.
|
privatedelete |
References BorrowedStackFrame().
| void BorrowedStackFrame::SetFrameIndex | ( | uint32_t | index | ) |
Definition at line 38 of file BorrowedStackFrame.cpp.
References m_new_frame_index.
|
staticprivate |
Definition at line 138 of file BorrowedStackFrame.h.
|
private |
Definition at line 135 of file BorrowedStackFrame.h.
Referenced by BorrowedStackFrame(), ChangePC(), Disassemble(), FindVariable(), GetBorrowedFrame(), GetDisplayFunctionName(), GetFrameBaseExpression(), GetFrameBaseValue(), GetFrameBlock(), GetFrameCodeAddress(), GetFrameCodeAddressForSymbolication(), GetFunctionName(), GetInScopeVariableList(), GetLanguage(), GetLanguageSpecificData(), GetRecognizedFrame(), GetRegisterContext(), GetStackID(), GetSymbolContext(), GetValueForVariableExpressionPath(), GetValueObjectForFrameVariable(), GetVariableList(), GuessLanguage(), GuessValueForAddress(), GuessValueForRegisterAndOffset(), HasDebugInformation(), IsArtificial(), IsHidden(), IsHistorical(), IsInlined(), and IsSynthetic().
|
private |
Definition at line 137 of file BorrowedStackFrame.h.
Referenced by BorrowedStackFrame(), and GetConcreteFrameIndex().
|
private |
Definition at line 136 of file BorrowedStackFrame.h.
Referenced by BorrowedStackFrame(), GetFrameIndex(), and SetFrameIndex().