LLDB  mainline
Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
lldb_private::StackFrame Class Reference

This base class provides an interface to stack frames. More...

#include "lldb/Target/StackFrame.h"

Inheritance diagram for lldb_private::StackFrame:
Inheritance graph
[legend]
Collaboration diagram for lldb_private::StackFrame:
Collaboration graph
[legend]

Public Types

enum  ExpressionPathOption {
  eExpressionPathOptionCheckPtrVsMember = (1u << 0), eExpressionPathOptionsNoFragileObjcIvar = (1u << 1), eExpressionPathOptionsNoSyntheticChildren = (1u << 2), eExpressionPathOptionsNoSyntheticArrayRange = (1u << 3),
  eExpressionPathOptionsAllowDirectIVarAccess = (1u << 4), eExpressionPathOptionsInspectAnonymousUnions = (1u << 5)
}
 
enum  Kind { Kind::Regular, Kind::History, Kind::Artificial }
 

Public Member Functions

 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, const SymbolContext *sc_ptr)
 Construct a StackFrame object without supplying a RegisterContextSP. More...
 
 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, 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, const SymbolContext *sc_ptr)
 
 ~StackFrame () override
 
lldb::ThreadSP GetThread () const
 
StackIDGetStackID ()
 
const AddressGetFrameCodeAddress ()
 Get an Address for the current pc value in this StackFrame. More...
 
bool ChangePC (lldb::addr_t pc)
 Change the pc value for a given thread. More...
 
const SymbolContextGetSymbolContext (lldb::SymbolContextItem resolve_scope)
 Provide a SymbolContext for this StackFrame's current pc value. More...
 
bool GetFrameBaseValue (Scalar &value, Status *error_ptr)
 Return the Canonical Frame Address (DWARF term) for this frame. More...
 
DWARFExpressionGetFrameBaseExpression (Status *error_ptr)
 Get the DWARFExpression corresponding to the Canonical Frame Address. More...
 
BlockGetFrameBlock ()
 Get the current lexical scope block for this StackFrame, if possible. More...
 
lldb::RegisterContextSP GetRegisterContext ()
 Get the RegisterContext for this frame, if possible. More...
 
const lldb::RegisterContextSP & GetRegisterContextSP () const
 
VariableListGetVariableList (bool get_file_globals)
 Retrieve the list of variables that are in scope at this StackFrame's pc. More...
 
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. More...
 
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. More...
 
bool HasDebugInformation ()
 Determine whether this StackFrame has debug information available or not. More...
 
const char * Disassemble ()
 Return the disassembly for the instructions of this StackFrame's function as a single C string. More...
 
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. More...
 
void Dump (Stream *strm, bool show_frame_index, bool show_fullpaths)
 Print a description for this frame using a default format. More...
 
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. More...
 
bool IsInlined ()
 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. More...
 
bool IsHistorical () const
 Query whether this frame is part of a historical backtrace. More...
 
bool IsArtificial () const
 Query whether this frame is artificial (e.g a synthesized result of inferring missing tail call frames from a backtrace). More...
 
uint32_t GetFrameIndex () const
 Query this frame to find what frame it is in this Thread's StackFrameList. More...
 
void SetFrameIndex (uint32_t index)
 Set this frame's synthetic frame index. More...
 
uint32_t GetConcreteFrameIndex () const
 Query this frame to find what frame it is in this Thread's StackFrameList, not counting inlined frames. More...
 
lldb::ValueObjectSP GetValueObjectForFrameVariable (const lldb::VariableSP &variable_sp, lldb::DynamicValueType use_dynamic)
 Create a ValueObject for a given Variable in this StackFrame. More...
 
lldb::ValueObjectSP TrackGlobalVariable (const lldb::VariableSP &variable_sp, lldb::DynamicValueType use_dynamic)
 Add an arbitrary Variable object (e.g. More...
 
lldb::LanguageType GetLanguage ()
 Query this frame to determine what the default language should be when parsing expressions given the execution context. More...
 
lldb::LanguageType GuessLanguage ()
 
lldb::ValueObjectSP GuessValueForAddress (lldb::addr_t addr)
 Attempt to econstruct the ValueObject for a given raw address touched by the current instruction. More...
 
lldb::ValueObjectSP GuessValueForRegisterAndOffset (ConstString reg, int64_t offset)
 Attempt to reconstruct the ValueObject for the address contained in a given register plus an offset. More...
 
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. More...
 
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. More...
 
lldb::RecognizedStackFrameSP GetRecognizedFrame ()
 
- Public Member Functions inherited from lldb_private::ExecutionContextScope
virtual ~ExecutionContextScope ()
 

Protected Member Functions

void SetSymbolContextScope (SymbolContextScope *symbol_scope)
 
void UpdateCurrentFrameFromPreviousFrame (StackFrame &prev_frame)
 
void UpdatePreviousFrameFromCurrentFrame (StackFrame &curr_frame)
 
bool HasCachedData () const
 

Friends

class StackFrameList
 

Detailed Description

This base class provides an interface to stack frames.

StackFrames may have a Canonical Frame Address (CFA) or not. A frame may have a plain pc value or it may indicate a specific point in the debug session so the correct section load list is used for symbolication.

Local variables may be available, or not. A register context may be available, or not.

Definition at line 40 of file StackFrame.h.

Member Enumeration Documentation

◆ ExpressionPathOption

Enumerator
eExpressionPathOptionCheckPtrVsMember 
eExpressionPathOptionsNoFragileObjcIvar 
eExpressionPathOptionsNoSyntheticChildren 
eExpressionPathOptionsNoSyntheticArrayRange 
eExpressionPathOptionsAllowDirectIVarAccess 
eExpressionPathOptionsInspectAnonymousUnions 

Definition at line 43 of file StackFrame.h.

◆ Kind

Enumerator
Regular 

A regular stack frame with access to registers and local variables.

History 

A historical stack frame – possibly without CFA or registers or local variables.

Artificial 

An artificial stack frame (e.g.

a synthesized result of inferring missing tail call frames from a backtrace) with limited support for local variables.

Definition at line 52 of file StackFrame.h.

Constructor & Destructor Documentation

◆ StackFrame() [1/3]

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,
const SymbolContext sc_ptr 
)

Construct a StackFrame object without supplying a RegisterContextSP.

This is the one constructor that doesn't take a RegisterContext parameter. This ctor may be called when creating a history StackFrame; these are used if we've collected a stack trace of pc addresses at some point in the past. We may only have pc values. We may have a CFA, or more likely, we won't.

Parameters
[in]thread_spThe Thread that this frame belongs to.
[in]frame_idxThis StackFrame's frame index number in the Thread. If inlined stack frames are being created, this may differ from the concrete_frame_idx which is the frame index without any inlined stack frames.
[in]concrete_frame_idxThe StackFrame's frame index number in the Thread without any inlined stack frames being included in the index.
[in]cfaThe Canonical Frame Address (this terminology from DWARF) for this stack frame. The CFA for a stack frame does not change over the span of the stack frame's existence. It is often the value of the caller's stack pointer before the call instruction into this frame's function. It is usually not the same as the frame pointer register's value.
[in]cfa_is_validA history stack frame may not have a CFA value collected. We want to distinguish between "no CFA available" and a CFA of LLDB_INVALID_ADDRESS.
[in]pcThe current pc value of this stack frame.
[in]frame_kind
[in]sc_ptrOptionally seed the StackFrame with the SymbolContext information that has already been discovered.

◆ StackFrame() [2/3]

lldb_private::StackFrame::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,
const SymbolContext sc_ptr 
)

◆ StackFrame() [3/3]

lldb_private::StackFrame::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,
const SymbolContext sc_ptr 
)

◆ ~StackFrame()

StackFrame::~StackFrame ( )
overridedefault

Member Function Documentation

◆ CalculateExecutionContext()

void StackFrame::CalculateExecutionContext ( ExecutionContext exe_ctx)
overridevirtual

Reconstruct the object's execution context into sc.

The object should fill in as much of the ExecutionContextScope as it can so function calls that require a execution context can be made for the given object.

Parameters
[out]exe_ctxA reference to an execution context object that gets filled in.

Implements lldb_private::ExecutionContextScope.

Definition at line 1779 of file StackFrame.cpp.

References lldb_private::ExecutionContext::SetContext().

Referenced by GetConcreteFrameIndex(), lldb_private::InferiorCall(), lldb_private::InferiorCallMmap(), and lldb_private::InferiorCallMunmap().

◆ CalculateProcess()

ProcessSP StackFrame::CalculateProcess ( )
overridevirtual

◆ CalculateStackFrame()

StackFrameSP StackFrame::CalculateStackFrame ( )
overridevirtual

Implements lldb_private::ExecutionContextScope.

Definition at line 1777 of file StackFrame.cpp.

Referenced by GetConcreteFrameIndex(), and GetRecognizedFrame().

◆ CalculateTarget()

TargetSP StackFrame::CalculateTarget ( )
overridevirtual

◆ CalculateThread()

ThreadSP StackFrame::CalculateThread ( )
overridevirtual

Implements lldb_private::ExecutionContextScope.

Definition at line 1775 of file StackFrame.cpp.

References GetThread().

Referenced by GetConcreteFrameIndex().

◆ ChangePC()

bool StackFrame::ChangePC ( lldb::addr_t  pc)

Change the pc value for a given thread.

Change the current pc value for the frame on this thread.

Parameters
[in]pcThe load address that the pc will be set to.
Returns
true if the pc was changed. false if this failed – possibly because this frame is not a live StackFrame.

Definition at line 209 of file StackFrame.cpp.

References lldb_private::SymbolContext::Clear(), GetThread(), IsHistorical(), lldb_private::Flags::Reset(), and lldb_private::Address::SetRawAddress().

Referenced by GetThread().

◆ Disassemble()

const char * StackFrame::Disassemble ( )

◆ Dump()

void StackFrame::Dump ( Stream strm,
bool  show_frame_index,
bool  show_fullpaths 
)

Print a description for this frame using a default format.

Parameters
[in]strmThe Stream to print the description to.
[in]show_frame_indexWhether to print the frame number or not.
[in]show_fullpathsWhether to print the full source paths or just the file base name.

Definition at line 1813 of file StackFrame.cpp.

References lldb_private::ArchSpec::GetAddressByteSize(), lldb_private::Target::GetArchitecture(), lldb_private::ExecutionContext::GetBestExecutionContextScope(), GetFrameCodeAddress(), lldb_private::Address::GetLoadAddress(), GetSymbolContext(), lldb_private::ExecutionContext::GetTargetPtr(), and lldb_private::Stream::Printf().

Referenced by DumpUsingSettingsFormat(), and GetRegisterContextSP().

◆ DumpUsingSettingsFormat()

void StackFrame::DumpUsingSettingsFormat ( Stream strm,
bool  show_unique = false,
const char *  frame_marker = nullptr 
)

Print a description for this frame using the frame-format formatter settings.

Parameters
[in]strmThe Stream to print the description to.
[in]show_uniqueWhether to print the function arguments or not for backtrace unique.
[in]frame_markerOptional string that will be prepended to the frame output description.

Definition at line 1783 of file StackFrame.cpp.

References Dump(), lldb_private::Stream::EOL(), lldb_private::FormatEntity::Format(), lldb_private::Target::GetDebugger(), lldb_private::Debugger::GetFrameFormat(), lldb_private::Debugger::GetFrameFormatUnique(), lldb_private::StreamString::GetString(), GetSymbolContext(), lldb_private::ExecutionContext::GetTargetPtr(), and lldb_private::Stream::PutCString().

Referenced by lldb_private::StackFrameList::Dump(), GetRegisterContextSP(), and GetStatus().

◆ FindVariable()

lldb::ValueObjectSP StackFrame::FindVariable ( ConstString  name)

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.

Returns
The ValueObject if found.

Definition at line 1721 of file StackFrame.cpp.

References lldb_private::Block::AppendVariables(), lldb_private::SymbolContext::block, CalculateProcess(), CalculateTarget(), lldb::eNoDynamicValues, lldb_private::VariableList::FindVariable(), GetSymbolContext(), and GetValueObjectForFrameVariable().

Referenced by GetConcreteFrameIndex().

◆ GetConcreteFrameIndex()

uint32_t lldb_private::StackFrame::GetConcreteFrameIndex ( ) const
inline

◆ GetFrameBaseExpression()

DWARFExpression * StackFrame::GetFrameBaseExpression ( Status error_ptr)

Get the DWARFExpression corresponding to the Canonical Frame Address.

Often a register (bp), but sometimes a register + offset.

Parameters
[out]error_ptrIf there is an error determining the CFA address, this may contain a string explaining the failure.
Returns
Returns the corresponding DWARF expression, or NULL.

Definition at line 1110 of file StackFrame.cpp.

References lldb_private::SymbolContext::function, lldb_private::Function::GetFrameBaseExpression(), and lldb_private::Status::SetErrorString().

Referenced by GetThread(), and lldb_private::DWARFExpression::MatchesOperand().

◆ GetFrameBaseValue()

bool StackFrame::GetFrameBaseValue ( Scalar value,
Status error_ptr 
)

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.

Parameters
[out]valueThe address of the CFA for this frame, if available.
[out]error_ptrIf there is an error determining the CFA address, this may contain a string explaining the failure.
Returns
Returns true if the CFA value was successfully set in value. Some frames may be unable to provide this value; they will return false.

Definition at line 1064 of file StackFrame.cpp.

References lldb_private::Status::Clear(), lldb_private::Scalar::Clear(), lldb_private::DWARFExpression::Evaluate(), lldb_private::SymbolContext::function, lldb_private::Function::GetAddressRange(), lldb_private::AddressRange::GetBaseAddress(), lldb_private::Function::GetFrameBaseExpression(), lldb_private::Address::GetLoadAddress(), lldb_private::ExecutionContext::GetTargetPtr(), GOT_FRAME_BASE, lldb_private::Flags::IsClear(), lldb_private::DWARFExpression::IsLocationList(), LLDB_INVALID_ADDRESS, lldb_private::Value::ResolveValue(), lldb_private::Flags::Set(), lldb_private::Status::SetErrorString(), and lldb_private::Status::Success().

Referenced by lldb_private::DWARFExpression::Evaluate(), and GetThread().

◆ GetFrameBlock()

Block * StackFrame::GetFrameBlock ( )

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.

Returns
A pointer to the current Block. nullptr is returned if this can not be provided.

Definition at line 242 of file StackFrame.cpp.

References lldb_private::SymbolContext::block, lldb_private::SymbolContext::function, lldb_private::Function::GetBlock(), lldb_private::Block::GetContainingInlinedBlock(), GetSymbolContext(), and lldb_private::Flags::IsClear().

Referenced by GetStackID(), GetThread(), GetVariableList(), GuessValueForRegisterAndOffset(), SupportsCxxModuleImport(), and FrameVariablesWindowDelegate::WindowDelegateDraw().

◆ GetFrameCodeAddress()

const Address & StackFrame::GetFrameCodeAddress ( )

◆ GetFrameIndex()

uint32_t StackFrame::GetFrameIndex ( ) const

Query this frame to find what frame it is in this Thread's StackFrameList.

Returns
StackFrame index 0 indicates the currently-executing function. Inline frames are included in this frame index count.

Definition at line 166 of file StackFrame.cpp.

References GetThread().

Referenced by CommandObjectTargetVariable::DoExecute(), lldb_private::FormatEntity::Format(), GetRegisterContextSP(), and StatusBarWindowDelegate::WindowDelegateDraw().

◆ GetInScopeVariableList()

VariableListSP StackFrame::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.

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.

Parameters
[in]get_file_globalsWhether 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).
Returns
A pointer to a list of variables.

Definition at line 453 of file StackFrame.cpp.

References lldb_private::Block::AppendVariables(), lldb_private::SymbolContext::block, lldb_private::SymbolContext::comp_unit, GetSymbolContext(), lldb_private::CompileUnit::GetVariableList(), IsHistorical(), lldb_private::Variable::IsInScope(), and lldb_private::Variable::LocationIsValidForFrame().

Referenced by lldb_private::ClangExpressionDeclMap::FindExternalVisibleDecls(), GetRegisterContextSP(), and GetValueForVariableExpressionPath().

◆ GetLanguage()

lldb::LanguageType StackFrame::GetLanguage ( )

Query this frame to determine what the default language should be when parsing expressions given the execution context.

Returns
The language of the frame if known, else lldb::eLanguageTypeUnknown.

Definition at line 1208 of file StackFrame.cpp.

References lldb_private::SymbolContext::comp_unit, lldb::eLanguageTypeUnknown, lldb_private::CompileUnit::GetLanguage(), and GetSymbolContext().

Referenced by lldb::SBFrame::EvaluateExpression(), GetConcreteFrameIndex(), and GuessLanguage().

◆ GetRecognizedFrame()

RecognizedStackFrameSP StackFrame::GetRecognizedFrame ( )

◆ GetRegisterContext()

RegisterContextSP StackFrame::GetRegisterContext ( )

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.

Returns
The RegisterContext shared point for this frame.

Definition at line 1121 of file StackFrame.cpp.

References GetThread().

Referenced by DumpRegister(), lldb_private::DWARFExpression::Evaluate(), GetThread(), GuessValueForAddress(), EmulationStateARM::LoadPseudoRegistersFromFrame(), lldb_private::DWARFExpression::MatchesOperand(), lldb_private::EmulateInstruction::ReadRegisterFrame(), lldb_private::ThreadPlanStepInstruction::ShouldStop(), lldb_private::StackFrameList::SynthesizeTailCallFrames(), lldb_private::ValueObjectRegisterContext::UpdateValue(), lldb_private::ValueObjectRegisterSet::UpdateValue(), and lldb_private::EmulateInstruction::WriteRegisterFrame().

◆ GetRegisterContextSP()

const lldb::RegisterContextSP& lldb_private::StackFrame::GetRegisterContextSP ( ) const
inline

◆ GetStackID()

StackID & StackFrame::GetStackID ( )

◆ GetStatus()

bool StackFrame::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.

Parameters
[in]strmThe Stream to send the output to.
[in]show_frame_infoIf true, print the frame info by calling DumpUsingSettingsFormat().
[in]show_sourceIf true, print source or disassembly as per the user's settings.
[in]show_uniqueIf true, print using backtrace unique style, without function arguments as per the user's settings.
[in]frame_markerPassed to DumpUsingSettingsFormat() for the frame info printing.
Returns
Returns true if successful.

Definition at line 1884 of file StackFrame.cpp.

References lldb_private::Disassembler::Disassemble(), lldb_private::SourceManager::DisplaySourceLinesWithLineNumbers(), DumpUsingSettingsFormat(), lldb_private::Disassembler::eOptionMarkPCAddress, lldb_private::Debugger::eStopDisassemblyTypeAlways, lldb_private::Debugger::eStopDisassemblyTypeNever, lldb_private::Debugger::eStopDisassemblyTypeNoDebugInfo, lldb_private::Debugger::eStopDisassemblyTypeNoSource, lldb_private::Target::GetArchitecture(), lldb_private::AddressRange::GetBaseAddress(), lldb_private::Target::GetDebugger(), lldb_private::Debugger::GetDisassemblyLineCount(), GetFrameCodeAddress(), lldb_private::ArchSpec::GetMaximumOpcodeByteSize(), lldb_private::Target::GetSourceManager(), lldb_private::Debugger::GetStopDisassemblyDisplay(), lldb_private::Debugger::GetStopSourceLineCount(), GetSymbolContext(), lldb_private::ExecutionContext::GetTargetPtr(), lldb_private::Stream::Indent(), and lldb_private::AddressRange::SetByteSize().

Referenced by GetRegisterContextSP().

◆ GetSymbolContext()

const SymbolContext & StackFrame::GetSymbolContext ( lldb::SymbolContextItem  resolve_scope)

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.

Returns
A SymbolContext reference which includes the types of information requested by resolve_scope, if they are available.

Definition at line 267 of file StackFrame.cpp.

References lldb_private::LineEntry::ApplyFileMappings(), lldb_private::SymbolContext::block, CalculateTarget(), lldb_private::SymbolContext::comp_unit, lldb_private::SymbolContext::function, lldb_private::Flags::Get(), GetFrameCodeAddress(), lldb_private::Address::GetLoadAddress(), lldb_private::Address::GetOffset(), GetThread(), lldb_private::Flags::IsClear(), lldb_private::LineEntry::IsValid(), lldb_private::Address::IsValid(), lldb_private::SymbolContext::line_entry, lldb_private::SymbolContext::module_sp, RESOLVED_FRAME_CODE_ADDR, lldb_private::Flags::Set(), lldb_private::Address::SetLoadAddress(), lldb_private::Address::SetOffset(), lldb_private::SymbolContext::symbol, and lldb_private::SymbolContext::target_sp.

Referenced by lldb_private::ThreadPlanStepInRange::DefaultShouldStopHereCallback(), lldb_private::ThreadPlanShouldStopHere::DefaultShouldStopHereCallback(), lldb_private::ThreadPlanShouldStopHere::DefaultStepFromHereCallback(), lldb_private::Disassembler::Disassemble(), UnwindMacOSXFrameBackchain::DoCreateRegisterContextForFrame(), lldb_private::CommandObjectDisassemble::DoExecute(), CommandObjectMemoryRead::DoExecute(), CommandObjectFrameVariable::DoExecute(), CommandObjectThreadStepWithTypeAndScope::DoExecute(), CommandObjectBreakpointSet::DoExecute(), CommandObjectTargetVariable::DoExecute(), CommandObjectThreadUntil::DoExecute(), CommandObjectThreadJump::DoExecute(), CommandObjectTargetSymbolsAdd::DoExecute(), Dump(), CommandObjectSourceInfo::DumpLinesForFrame(), DumpUsingSettingsFormat(), lldb_private::ClangExpressionDeclMap::FindExternalVisibleDecls(), FindVariable(), lldb_private::StringSummaryFormat::FormatObject(), lldb_private::ThreadPlanStepInRange::FrameMatchesAvoidCriteria(), lldb_private::Thread::FunctionOptimizationWarning(), GetFrameBlock(), GetInScopeVariableList(), GetLanguage(), lldb_private::DWARFExpression::GetOpAndEndOffsets(), GetStackID(), GetStatus(), DynamicLoaderHexagonDYLD::GetStepThroughTrampolinePlan(), lldb_private::DynamicLoaderDarwin::GetStepThroughTrampolinePlan(), DynamicLoaderPOSIXDYLD::GetStepThroughTrampolinePlan(), lldb_private::ClangExpressionDeclMap::GetSymbolAddress(), lldb::SBFrame::GetSymbolContext(), GetThread(), GetValueForVariableExpressionPath(), GetVariableList(), GuessLanguage(), HasDebugInformation(), lldb_private::ThreadPlanStepRange::InRange(), IsInlined(), lldb_private::Variable::IsInScope(), lldb_private::Thread::JumpToLine(), lldb_private::Variable::LocationIsValidForFrame(), lldb_private::StackFrameList::SynthesizeTailCallFrames(), lldb_private::ClangExpressionDeclMap::WillParse(), and lldb_private::ClangUserExpression::~ClangUserExpression().

◆ GetThread()

lldb::ThreadSP lldb_private::StackFrame::GetThread ( ) const
inline

◆ GetValueForVariableExpressionPath()

ValueObjectSP StackFrame::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.

Parameters
[in]var_exprThe string specifying a variable to base the VariableObject off of.
[in]use_dynamicWhether 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]optionsAn unsigned integer of flags, values from StackFrame::ExpressionPathOption enum.
[in]var_spA VariableSP that will be set to the variable described in the var_expr path.
[in]errorRecord any errors encountered while evaluating var_expr.
Returns
A shared pointer to the ValueObject described by var_expr.

Definition at line 486 of file StackFrame.cpp.

References lldb_private::Status::Clear(), eExpressionPathOptionCheckPtrVsMember, eExpressionPathOptionsAllowDirectIVarAccess, eExpressionPathOptionsInspectAnonymousUnions, eExpressionPathOptionsNoFragileObjcIvar, eExpressionPathOptionsNoSyntheticChildren, lldb::eLanguageTypeObjC, lldb::eLanguageTypeUnknown, lldb::eNoDynamicValues, lldb_private::Status::Fail(), lldb_private::VariableList::FindVariable(), lldb_private::ConstString::GetCString(), lldb_private::StreamString::GetData(), lldb_private::Type::GetForwardCompilerType(), lldb_private::SymbolContext::GetFunctionMethodInfo(), GetInScopeVariableList(), lldb_private::ConstString::GetLength(), lldb_private::VariableList::GetSize(), GetSymbolContext(), GetValueObjectForFrameVariable(), lldb_private::VariableList::GetVariableAtIndex(), lldb_private::CompilerType::IsAnonymousType(), IsHistorical(), lldb_private::Status::SetErrorString(), lldb_private::Status::SetErrorStringWithFormat(), and lldb_private::Status::SetErrorStringWithFormatv().

Referenced by CommandObjectFrameVariable::DoExecute(), CommandObjectWatchpointSetVariable::DoExecute(), and GetRegisterContextSP().

◆ GetValueObjectForFrameVariable()

ValueObjectSP StackFrame::GetValueObjectForFrameVariable ( const lldb::VariableSP &  variable_sp,
lldb::DynamicValueType  use_dynamic 
)

◆ GetVariableList()

VariableList * StackFrame::GetVariableList ( bool  get_file_globals)

Retrieve the list of variables that are in scope at this StackFrame's pc.

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.

Parameters
[in]get_file_globalsWhether 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).
Returns
A pointer to a list of variables.

Definition at line 414 of file StackFrame.cpp.

References lldb_private::Block::AppendBlockVariables(), lldb_private::SymbolContext::comp_unit, GetFrameBlock(), GetSymbolContext(), lldb_private::CompileUnit::GetVariableList(), lldb_private::Flags::IsClear(), RESOLVED_GLOBAL_VARIABLES, RESOLVED_VARIABLES, and lldb_private::Flags::Set().

Referenced by CommandObjectFrameVariable::DoExecute(), lldb_private::ClangExpressionDeclMap::FindExternalVisibleDecls(), GetRegisterContextSP(), GetValueObjectForFrameVariable(), GuessValueForRegisterAndOffset(), PrivateAutoComplete(), TrackGlobalVariable(), and FrameVariablesWindowDelegate::WindowDelegateDraw().

◆ GuessLanguage()

lldb::LanguageType StackFrame::GuessLanguage ( )

◆ GuessValueForAddress()

lldb::ValueObjectSP StackFrame::GuessValueForAddress ( lldb::addr_t  addr)

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.

Returns
The ValueObject if found. If valid, it has a valid ExpressionPath.

Definition at line 1309 of file StackFrame.cpp.

References lldb_private::ConstString::AsCString(), lldb_private::Instruction::Operand::BuildDereference(), lldb_private::Instruction::Operand::BuildImmediate(), lldb_private::Instruction::Operand::BuildRegister(), lldb_private::Instruction::Operand::BuildSum(), CalculateProcess(), CalculateTarget(), lldb_private::ValueObjectMemory::Create(), lldb_private::Instruction::Operand::Dereference, lldb_private::Disassembler::DisassembleRange(), lldb::eBasicTypeChar, lldb::eLanguageTypeC, lldb::eNoDynamicValues, lldb_private::Status::Fail(), lldb_private::OperandMatchers::FetchImmOp, lldb_private::OperandMatchers::FetchRegOp, lldb_private::SymbolContext::function, lldb_private::RegisterValue::GetAsUInt64(), lldb_private::AddressRange::GetBaseAddress(), lldb_private::TypeSystem::GetBasicTypeFromAST(), lldb_private::Function::GetCompilerType(), GetFrameCodeAddress(), lldb_private::CompilerType::GetFunctionReturnType(), lldb_private::InstructionList::GetIndexOfInstructionAtAddress(), lldb_private::InstructionList::GetInstructionAtIndex(), lldb_private::Disassembler::GetInstructionList(), lldb_private::ArchSpec::GetMaximumOpcodeByteSize(), lldb_private::Function::GetName(), lldb_private::CompilerType::GetPointerType(), GetRegisterContext(), lldb_private::VariableList::GetSize(), GetValueObjectForFrameVariable(), lldb_private::VariableList::GetVariableAtIndex(), GuessValueForRegisterAndOffset(), lldb_private::Instruction::Operand::Immediate, lldb_private::CompilerType::IsFunctionType(), lldb_private::Instruction::Operand::m_clobbered, lldb_private::OperandMatchers::MatchBinaryOp, lldb_private::OperandMatchers::MatchOpType, lldb_private::OperandMatchers::MatchRegOp, lldb_private::OperandMatchers::MatchUnaryOp, pc, lldb_private::Instruction::Operand::Register, lldb_private::AddressRange::SetByteSize(), lldb_private::Instruction::Operand::Sum, and UINT32_MAX.

Referenced by GetConcreteFrameIndex().

◆ GuessValueForRegisterAndOffset()

lldb::ValueObjectSP StackFrame::GuessValueForRegisterAndOffset ( ConstString  reg,
int64_t  offset 
)

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...

Returns
The ValueObject if found. If valid, it has a valid ExpressionPath.

Definition at line 1671 of file StackFrame.cpp.

References lldb_private::Block::CalculateSymbolContextFunction(), CalculateTarget(), lldb_private::Disassembler::DisassembleRange(), lldb_private::AddressRange::GetBaseAddress(), lldb_private::AddressRange::GetByteSize(), lldb_private::Address::GetFileAddress(), GetFrameBlock(), GetFrameCodeAddress(), and GetVariableList().

Referenced by GetConcreteFrameIndex(), and GuessValueForAddress().

◆ HasCachedData()

bool StackFrame::HasCachedData ( ) const
protected

Definition at line 1874 of file StackFrame.cpp.

◆ HasDebugInformation()

bool StackFrame::HasDebugInformation ( )

◆ IsArtificial()

bool StackFrame::IsArtificial ( ) const

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.

Definition at line 1204 of file StackFrame.cpp.

References Artificial.

Referenced by GetRegisterContextSP(), and lldb::SBFrame::IsArtificial().

◆ IsHistorical()

bool StackFrame::IsHistorical ( ) const

Query whether this frame is part of a historical backtrace.

Definition at line 1200 of file StackFrame.cpp.

References History.

Referenced by ChangePC(), GetInScopeVariableList(), GetRegisterContextSP(), GetValueForVariableExpressionPath(), GetValueObjectForFrameVariable(), and TrackGlobalVariable().

◆ IsInlined()

bool StackFrame::IsInlined ( )

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.

Definition at line 1192 of file StackFrame.cpp.

References lldb_private::SymbolContext::block, lldb_private::Block::GetContainingInlinedBlock(), and GetSymbolContext().

Referenced by GetRegisterContextSP().

◆ SetFrameIndex()

void lldb_private::StackFrame::SetFrameIndex ( uint32_t  index)
inline

Set this frame's synthetic frame index.

Definition at line 379 of file StackFrame.h.

Referenced by lldb_private::StackFrameList::SynthesizeTailCallFrames().

◆ SetSymbolContextScope()

void StackFrame::SetSymbolContextScope ( SymbolContextScope symbol_scope)
protected

◆ TrackGlobalVariable()

ValueObjectSP StackFrame::TrackGlobalVariable ( const lldb::VariableSP &  variable_sp,
lldb::DynamicValueType  use_dynamic 
)

Add an arbitrary Variable object (e.g.

one that specifics a global or static) to a StackFrame's list of ValueObjects.

[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.

Returns

Definition at line 1167 of file StackFrame.cpp.

References GetValueObjectForFrameVariable(), GetVariableList(), and IsHistorical().

Referenced by GetConcreteFrameIndex().

◆ UpdateCurrentFrameFromPreviousFrame()

void StackFrame::UpdateCurrentFrameFromPreviousFrame ( StackFrame prev_frame)
protected

Definition at line 1837 of file StackFrame.cpp.

References GetStackID(), and lldb_private::StreamString::GetString().

◆ UpdatePreviousFrameFromCurrentFrame()

void StackFrame::UpdatePreviousFrameFromCurrentFrame ( StackFrame curr_frame)
protected

Friends And Related Function Documentation

◆ StackFrameList

friend class StackFrameList
friend

Definition at line 487 of file StackFrame.h.


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