LLDB mainline
lldb_private::ScriptedFrame Class Reference

#include <ScriptedFrame.h>

Inheritance diagram for lldb_private::ScriptedFrame:
[legend]

Public Member Functions

 ScriptedFrame (ScriptedThread &thread, lldb::ScriptedFrameInterfaceSP interface_sp, lldb::user_id_t frame_idx, lldb::addr_t pc, SymbolContext &sym_ctx, lldb::RegisterContextSP reg_ctx_sp, std::shared_ptr< DynamicRegisterInfo > reg_info_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.
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 &reg_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 &reg_context_sp, lldb::addr_t cfa, const Address &pc, bool behaves_like_zeroth_frame, const SymbolContext *sc_ptr)
 ~StackFrame () override
lldb::ThreadSP GetThread () const
StackIDGetStackID ()
const AddressGetFrameCodeAddress ()
 Get an Address for the current pc value in this StackFrame.
Address GetFrameCodeAddressForSymbolication ()
 Get the current code Address suitable for symbolication, may not be the same as GetFrameCodeAddress().
bool ChangePC (lldb::addr_t pc)
 Change the pc value for a given thread.
const SymbolContextGetSymbolContext (lldb::SymbolContextItem resolve_scope)
 Provide a SymbolContext for this StackFrame's current pc value.
llvm::Error GetFrameBaseValue (Scalar &value)
 Return the Canonical Frame Address (DWARF term) for this frame.
DWARFExpressionListGetFrameBaseExpression (Status *error_ptr)
 Get the DWARFExpressionList corresponding to the Canonical Frame Address.
BlockGetFrameBlock ()
 Get the current lexical scope block for this StackFrame, if possible.
lldb::RegisterContextSP GetRegisterContext ()
 Get the RegisterContext for this frame, if possible.
const lldb::RegisterContextSPGetRegisterContextSP () const
VariableListGetVariableList (bool get_file_globals, Status *error_ptr)
 Retrieve the list of variables whose scope either:
lldb::VariableListSP GetInScopeVariableList (bool get_file_globals, bool must_have_valid_location=false)
 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)
 Create a ValueObject for a variable name / pathname, possibly including simple dereference/child selection syntax.
bool HasDebugInformation ()
 Determine whether this StackFrame has debug information available or not.
const char * Disassemble ()
 Return the disassembly for the instructions of this StackFrame's function as a single C string.
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.
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.
void Dump (Stream *strm, bool show_frame_index, bool show_fullpaths)
 Print a description for this frame using a default format.
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.
bool IsSynthetic () const
 Query whether this frame is synthetic.
bool IsHistorical () const
 Query whether this frame is part of a historical backtrace.
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.
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 synthetic frame index.
uint32_t GetConcreteFrameIndex () const
 Query this frame to find what frame it is in this Thread's StackFrameList, not counting inlined frames.
lldb::ValueObjectSP GetValueObjectForFrameVariable (const lldb::VariableSP &variable_sp, lldb::DynamicValueType use_dynamic)
 Create a ValueObject for a given Variable in this StackFrame.
SourceLanguage GetLanguage ()
 Query this frame to determine what the default language should be when parsing expressions given the execution context.
SourceLanguage GuessLanguage ()
 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)
 Attempt to econstruct the ValueObject for a given raw address touched by the current instruction.
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::ValueObjectSP FindVariable (ConstString name)
 Attempt to reconstruct the ValueObject for a variable with a given name from within the current StackFrame, within the current block.
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.
lldb::RecognizedStackFrameSP GetRecognizedFrame ()
Public Member Functions inherited from lldb_private::ExecutionContextScope
virtual ~ExecutionContextScope ()=default

Static Public Member Functions

static llvm::Expected< std::shared_ptr< ScriptedFrame > > Create (ScriptedThread &thread, StructuredData::DictionarySP args_sp, StructuredData::Generic *script_object=nullptr)

Private Member Functions

void CheckInterpreterAndScriptObject () const
lldb::ScriptedFrameInterfaceSP GetInterface () const
 ScriptedFrame (const ScriptedFrame &)=delete
const ScriptedFrameoperator= (const ScriptedFrame &)=delete
std::shared_ptr< DynamicRegisterInfoGetDynamicRegisterInfo ()

Private Attributes

lldb::ScriptedFrameInterfaceSP m_scripted_frame_interface_sp
lldb_private::StructuredData::GenericSP m_script_object_sp
std::shared_ptr< DynamicRegisterInfom_register_info_sp

Additional Inherited Members

Public Types inherited from lldb_private::StackFrame
enum  ExpressionPathOption {
  eExpressionPathOptionCheckPtrVsMember = (1u << 0) , eExpressionPathOptionsNoFragileObjcIvar = (1u << 1) , eExpressionPathOptionsNoSyntheticChildren = (1u << 2) , eExpressionPathOptionsNoSyntheticArrayRange = (1u << 3) ,
  eExpressionPathOptionsAllowDirectIVarAccess = (1u << 4) , eExpressionPathOptionsInspectAnonymousUnions = (1u << 5)
}
enum class  Kind { Regular , History , Synthetic }
Protected Member Functions inherited from lldb_private::StackFrame
void SetSymbolContextScope (SymbolContextScope *symbol_scope)
void UpdateCurrentFrameFromPreviousFrame (StackFrame &prev_frame)
void UpdatePreviousFrameFromCurrentFrame (StackFrame &curr_frame)
bool HasCachedData () const
Protected Attributes inherited from lldb_private::StackFrame
Address m_frame_code_addr
 The frame code address (might not be the same as the actual PC for inlined frames) as a section/offset address.
SymbolContext m_sc
Flags m_flags
Scalar m_frame_base
Status m_frame_base_error
uint16_t m_frame_recognizer_generation = 0
bool m_cfa_is_valid
 Does this frame have a CFA? Different from CFA == LLDB_INVALID_ADDRESS.
Kind m_stack_frame_kind
bool m_artificial
 Is this an artificial stack frame (e.g.
bool m_behaves_like_zeroth_frame
 Whether this frame behaves like the zeroth frame, in the sense that its pc value might not immediately follow a call (and thus might be the first address of its function).
lldb::VariableListSP m_variable_list_sp
ValueObjectList m_variable_list_value_objects
 Value objects for each variable in m_variable_list_sp.
std::optional< lldb::RecognizedStackFrameSPm_recognized_frame_sp
StreamString m_disassembly
std::recursive_mutex m_mutex
lldb::ThreadWP m_thread_wp
 For StackFrame and derived classes only.
uint32_t m_frame_index
uint32_t m_concrete_frame_index
lldb::RegisterContextSP m_reg_context_sp
StackID m_id

Detailed Description

Definition at line 25 of file ScriptedFrame.h.

Constructor & Destructor Documentation

◆ ScriptedFrame() [1/2]

ScriptedFrame::ScriptedFrame ( ScriptedThread & thread,
lldb::ScriptedFrameInterfaceSP interface_sp,
lldb::user_id_t frame_idx,
lldb::addr_t pc,
SymbolContext & sym_ctx,
lldb::RegisterContextSP reg_ctx_sp,
std::shared_ptr< DynamicRegisterInfo > reg_info_sp,
StructuredData::GenericSP script_object_sp = nullptr )

◆ ~ScriptedFrame()

ScriptedFrame::~ScriptedFrame ( )
override

Definition at line 126 of file ScriptedFrame.cpp.

◆ ScriptedFrame() [2/2]

lldb_private::ScriptedFrame::ScriptedFrame ( const ScriptedFrame & )
privatedelete

References ScriptedFrame().

Member Function Documentation

◆ CheckInterpreterAndScriptObject()

void ScriptedFrame::CheckInterpreterAndScriptObject ( ) const
private

◆ Create()

◆ GetDisplayFunctionName()

const char * ScriptedFrame::GetDisplayFunctionName ( )
overridevirtual

Get the frame's demangled display name.

///

Returns
A C-String containing the function demangled display name. Can be null.

Reimplemented from lldb_private::StackFrame.

Definition at line 136 of file ScriptedFrame.cpp.

References lldb_private::ConstString::AsCString(), CheckInterpreterAndScriptObject(), and GetInterface().

◆ GetDynamicRegisterInfo()

◆ GetFunctionName()

const char * ScriptedFrame::GetFunctionName ( )
overridevirtual

Get the frame's demangled name.

///

Returns
A C-String containing the function demangled name. Can be null.

Reimplemented from lldb_private::StackFrame.

Definition at line 128 of file ScriptedFrame.cpp.

References lldb_private::ConstString::AsCString(), CheckInterpreterAndScriptObject(), and GetInterface().

◆ GetInterface()

◆ IsArtificial()

bool ScriptedFrame::IsArtificial ( ) const
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 147 of file ScriptedFrame.cpp.

References GetInterface().

◆ IsHidden()

bool ScriptedFrame::IsHidden ( )
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 151 of file ScriptedFrame.cpp.

References GetInterface().

◆ IsInlined()

bool ScriptedFrame::IsInlined ( )
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.

Returns
true if this is an inlined frame.

Reimplemented from lldb_private::StackFrame.

Definition at line 145 of file ScriptedFrame.cpp.

References GetInterface().

◆ operator=()

const ScriptedFrame & lldb_private::ScriptedFrame::operator= ( const ScriptedFrame & )
privatedelete

References ScriptedFrame().

Member Data Documentation

◆ m_register_info_sp

std::shared_ptr<DynamicRegisterInfo> lldb_private::ScriptedFrame::m_register_info_sp
private

Definition at line 58 of file ScriptedFrame.h.

Referenced by GetDynamicRegisterInfo(), and ScriptedFrame().

◆ m_script_object_sp

lldb_private::StructuredData::GenericSP lldb_private::ScriptedFrame::m_script_object_sp
private

Definition at line 57 of file ScriptedFrame.h.

Referenced by CheckInterpreterAndScriptObject(), and ScriptedFrame().

◆ m_scripted_frame_interface_sp

lldb::ScriptedFrameInterfaceSP lldb_private::ScriptedFrame::m_scripted_frame_interface_sp
private

Definition at line 56 of file ScriptedFrame.h.

Referenced by GetInterface(), and ScriptedFrame().


The documentation for this class was generated from the following files: