|
LLDB mainline
|
#include <ScriptedFrame.h>
Public Member Functions | |
| ScriptedFrame (lldb::ThreadSP thread_sp, lldb::ScriptedFrameInterfaceSP interface_sp, lldb::user_id_t frame_idx, lldb::addr_t pc, SymbolContext &sym_ctx, lldb::RegisterContextSP reg_ctx_sp, StructuredData::GenericSP script_object_sp=nullptr) | |
| ~ScriptedFrame () override | |
| 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 | 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::RegisterContextSP | GetRegisterContext () override |
| Get the RegisterContext for this frame, if possible. | |
| VariableList * | GetVariableList (bool get_file_globals, bool include_synthetic_vars, lldb_private::Status *error_ptr) override |
| Retrieve the list of variables whose scope either: | |
| lldb::VariableListSP | GetInScopeVariableList (bool get_file_globals, bool include_synthetic_vars, bool must_have_valid_location=false) override |
| Retrieve the list of variables that are in scope at this StackFrame's pc. | |
| lldb::ValueObjectSP | GetValueObjectForFrameVariable (const lldb::VariableSP &variable_sp, lldb::DynamicValueType use_dynamic) override |
| Create a ValueObject for a given Variable in this StackFrame. | |
| 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. | |
| lldb::ValueObjectSP | GetValueForVariableExpressionPath (llvm::StringRef var_expr, lldb::DynamicValueType use_dynamic, uint32_t options, lldb::VariableSP &var_sp, Status &error, lldb::DILMode mode=lldb::eDILModeFull) override |
| Create a ValueObject for a variable name / pathname, possibly including simple dereference/child selection syntax. | |
| 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 |
| virtual StackID & | GetStackID () |
| virtual const Address & | GetFrameCodeAddress () |
| Get an Address for the current pc value in this StackFrame. | |
| virtual Address | GetFrameCodeAddressForSymbolication () |
| Get the current code Address suitable for symbolication, may not be the same as GetFrameCodeAddress(). | |
| virtual bool | ChangePC (lldb::addr_t pc) |
| Change the pc value for a given thread. | |
| virtual const SymbolContext & | GetSymbolContext (lldb::SymbolContextItem resolve_scope) |
| Provide a SymbolContext for this StackFrame's current pc value. | |
| virtual llvm::Error | GetFrameBaseValue (Scalar &value) |
| Return the Canonical Frame Address (DWARF term) for this frame. | |
| virtual DWARFExpressionList * | GetFrameBaseExpression (Status *error_ptr) |
| Get the DWARFExpressionList corresponding to the Canonical Frame Address. | |
| virtual Block * | GetFrameBlock () |
| Get the current lexical scope block for this StackFrame, if possible. | |
| const lldb::RegisterContextSP & | GetRegisterContextSP () const |
| virtual bool | HasDebugInformation () |
| Determine whether this StackFrame has debug information available or not. | |
| virtual const char * | Disassemble () |
| Return the disassembly for the instructions of this StackFrame's function as a single C string. | |
| 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 llvm::StringRef frame_marker="") |
| 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 llvm::StringRef frame_marker="") |
| Print a description of this stack frame and/or the source context/assembly for this stack frame. | |
| virtual bool | IsSynthetic () const |
| Query whether this frame is synthetic. | |
| virtual bool | IsHistorical () const |
| Query whether this frame is part of a historical backtrace. | |
| virtual StructuredData::ObjectSP | GetLanguageSpecificData () |
| 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. | |
| virtual uint32_t | GetFrameIndex () const |
| Query this frame to find what frame it is in this Thread's StackFrameList. | |
| void | SetFrameIndex (uint32_t index) |
| Set this frame's frame index. | |
| virtual uint32_t | GetConcreteFrameIndex () |
| Query this frame to find what frame it is in this Thread's StackFrameList, not counting inlined frames. | |
| virtual SourceLanguage | GetLanguage () |
| Query this frame to determine what the default language should be when parsing expressions given the execution context. | |
| virtual SourceLanguage | GuessLanguage () |
| Similar to GetLanguage(), but is allowed to take a potentially incorrect guess if exact information is not available. | |
| virtual lldb::ValueObjectSP | GuessValueForAddress (lldb::addr_t addr) |
| Attempt to econstruct the ValueObject for a given raw address touched by the current instruction. | |
| virtual lldb::ValueObjectSP | GuessValueForRegisterAndOffset (ConstString reg, int64_t offset) |
| Attempt to reconstruct the ValueObject for the address contained in a given register plus an offset. | |
| 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::RecognizedStackFrameSP | GetRecognizedFrame () |
| lldb::frame_list_id_t | GetContainingStackFrameListIdentifier () const |
| Get the identifier of the StackFrameList that contains this frame. | |
| Public Member Functions inherited from lldb_private::ExecutionContextScope | |
| virtual | ~ExecutionContextScope ()=default |
Static Public Member Functions | |
| static llvm::Expected< std::shared_ptr< ScriptedFrame > > | Create (lldb::ThreadSP thread_sp, lldb::ScriptedThreadInterfaceSP scripted_thread_interface_sp, StructuredData::DictionarySP args_sp, StructuredData::Generic *script_object=nullptr) |
| Create a ScriptedFrame from a object instanciated in the script interpreter. | |
| static bool | classof (const StackFrame *obj) |
| static bool | classof (const StackFrame *obj) |
Private Member Functions | |
| void | CheckInterpreterAndScriptObject () const |
| lldb::ScriptedFrameInterfaceSP | GetInterface () const |
| void | PopulateVariableListFromInterface (bool include_synthetic_vars=true) |
| ScriptedFrame (const ScriptedFrame &)=delete | |
| const ScriptedFrame & | operator= (const ScriptedFrame &)=delete |
| std::shared_ptr< DynamicRegisterInfo > | GetDynamicRegisterInfo () |
Static Private Member Functions | |
| static llvm::Expected< lldb::RegisterContextSP > | CreateRegisterContext (ScriptedFrameInterface &interface, Thread &thread, lldb::user_id_t frame_id) |
Private Attributes | |
| lldb::ScriptedFrameInterfaceSP | m_scripted_frame_interface_sp |
| lldb_private::StructuredData::GenericSP | m_script_object_sp |
| lldb::VariableListSP | m_variable_list_sp |
Static Private Attributes | |
| static char | ID |
Definition at line 22 of file ScriptedFrame.h.
| ScriptedFrame::ScriptedFrame | ( | lldb::ThreadSP | thread_sp, |
| lldb::ScriptedFrameInterfaceSP | interface_sp, | ||
| lldb::user_id_t | frame_idx, | ||
| lldb::addr_t | pc, | ||
| SymbolContext & | sym_ctx, | ||
| lldb::RegisterContextSP | reg_ctx_sp, | ||
| StructuredData::GenericSP | script_object_sp = nullptr ) |
Definition at line 132 of file ScriptedFrame.cpp.
References m_script_object_sp, m_scripted_frame_interface_sp, lldb_private::StackFrame::m_stack_frame_kind, pc, lldb_private::StackFrame::StackFrame(), and lldb_private::StackFrame::Synthetic.
Referenced by operator=(), and ScriptedFrame().
|
override |
Definition at line 148 of file ScriptedFrame.cpp.
|
privatedelete |
References ScriptedFrame().
|
private |
Definition at line 47 of file ScriptedFrame.cpp.
References GetInterface(), lldbassert, and m_script_object_sp.
Referenced by GetDisplayFunctionName(), GetDynamicRegisterInfo(), and GetFunctionName().
|
inlinestatic |
Definition at line 88 of file ScriptedFrame.h.
References ID, lldb_private::StackFrame::isA(), and lldb_private::StackFrame::StackFrame().
|
static |
Create a ScriptedFrame from a object instanciated in the script interpreter.
| [in] | thread_sp | The thread this frame belongs to. |
| [in] | scripted_thread_interface_sp | The scripted thread interface (needed for ScriptedThread compatibility). Can be nullptr for frames on real threads. |
| [in] | args_sp | Arguments to pass to the frame creation. |
| [in] | script_object | The optional script object representing this frame. |
Definition at line 53 of file ScriptedFrame.cpp.
References lldb_private::Address::CalculateSymbolContext(), CreateRegisterContext(), lldb_private::ScriptInterpreter::CreateScriptedFrameInterface(), lldb_private::GetLog(), LLDB_INVALID_ADDRESS, LLDB_LOG_ERROR, pc, lldb_private::Address::SetLoadAddress(), and lldb_private::Thread.
Referenced by lldb_private::ScriptedFrameProvider::GetFrameAtIndex(), and lldb_private::ScriptedThread::LoadArtificialStackFrames().
|
staticprivate |
Definition at line 212 of file ScriptedFrame.cpp.
References lldb_private::DynamicRegisterInfo::Create(), lldb_private::ScriptedFrameInterface::GetRegisterContext(), lldb_private::ScriptedFrameInterface::GetRegisterInfo(), and LLDB_INVALID_ADDRESS.
Referenced by Create(), and GetRegisterContext().
|
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 345 of file ScriptedFrame.cpp.
References lldb_private::ConstString::AsCString(), and m_scripted_frame_interface_sp.
|
overridevirtual |
Get the frame's demangled display name.
///
Reimplemented from lldb_private::StackFrame.
Definition at line 158 of file ScriptedFrame.cpp.
References lldb_private::ConstString::AsCString(), CheckInterpreterAndScriptObject(), lldb_private::StackFrame::GetDisplayFunctionName(), and GetInterface().
|
private |
Definition at line 179 of file ScriptedFrame.cpp.
References CheckInterpreterAndScriptObject(), lldb_private::DynamicRegisterInfo::Create(), error(), lldb_private::ScriptedInterface::ErrorWithMessage(), GetInterface(), lldb_private::StackFrame::m_thread_wp, and lldb_private::Thread.
|
overridevirtual |
Get the frame's demangled name.
///
Reimplemented from lldb_private::StackFrame.
Definition at line 150 of file ScriptedFrame.cpp.
References lldb_private::ConstString::AsCString(), CheckInterpreterAndScriptObject(), lldb_private::StackFrame::GetFunctionName(), and GetInterface().
|
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] | include_synthetic_vars | Whether to also include synthetic variables from other sources. For example, synthetic frames can produce variables that aren't strictly 'variables', but can still be displayed with their values. Defaults to true because we are assuming that if a user's context has synthetic variables, they want them shown. |
| [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 287 of file ScriptedFrame.cpp.
References m_variable_list_sp, and PopulateVariableListFromInterface().
|
private |
Definition at line 175 of file ScriptedFrame.cpp.
References m_scripted_frame_interface_sp.
Referenced by CheckInterpreterAndScriptObject(), GetDisplayFunctionName(), GetDynamicRegisterInfo(), GetFunctionName(), IsArtificial(), IsHidden(), IsInlined(), and PopulateVariableListFromInterface().
|
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 247 of file ScriptedFrame.cpp.
References CreateRegisterContext(), error(), lldb_private::ScriptedInterface::ErrorWithMessage(), lldb_private::Status::FromError(), lldb_private::StackFrame::GetFrameIndex(), lldb_private::StackFrame::GetThread(), lldb_private::StackFrame::m_reg_context_sp, m_scripted_frame_interface_sp, and lldb_private::Thread.
|
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. |
| [in] | mode | Data Inspection Language (DIL) evaluation mode. |
Reimplemented from lldb_private::StackFrame.
Definition at line 354 of file ScriptedFrame.cpp.
References error(), and m_scripted_frame_interface_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 334 of file ScriptedFrame.cpp.
References m_scripted_frame_interface_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). |
| [in] | include_synthetic_vars | Whether to also include synthetic variables from other sources. For example, synthetic frames can produce variables that aren't strictly 'variables', but can still be displayed with their values. |
| [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 279 of file ScriptedFrame.cpp.
References m_variable_list_sp, and PopulateVariableListFromInterface().
|
inlineoverridevirtual |
Reimplemented from lldb_private::StackFrame.
Definition at line 85 of file ScriptedFrame.h.
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 169 of file ScriptedFrame.cpp.
References GetInterface().
|
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 173 of file ScriptedFrame.cpp.
References GetInterface().
|
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 167 of file ScriptedFrame.cpp.
References GetInterface().
|
privatedelete |
References ScriptedFrame().
|
private |
Definition at line 294 of file ScriptedFrame.cpp.
References GetInterface(), lldb_private::GetSyntheticValueType(), and m_variable_list_sp.
Referenced by GetInScopeVariableList(), and GetVariableList().
|
staticprivate |
Definition at line 113 of file ScriptedFrame.h.
|
private |
Definition at line 110 of file ScriptedFrame.h.
Referenced by CheckInterpreterAndScriptObject(), and ScriptedFrame().
|
private |
Definition at line 109 of file ScriptedFrame.h.
Referenced by FindVariable(), GetInterface(), GetRegisterContext(), GetValueForVariableExpressionPath(), GetValueObjectForFrameVariable(), and ScriptedFrame().
|
private |
Definition at line 111 of file ScriptedFrame.h.
Referenced by GetInScopeVariableList(), GetVariableList(), and PopulateVariableListFromInterface().