LLDB mainline
lldb_private::RegisterContextUnwind Class Reference

#include <RegisterContextUnwind.h>

Inheritance diagram for lldb_private::RegisterContextUnwind:
[legend]

Public Types

typedef std::shared_ptr< RegisterContextUnwindSharedPtr

Public Member Functions

 RegisterContextUnwind (lldb_private::Thread &thread, const SharedPtr &next_frame, lldb_private::SymbolContext &sym_ctx, uint32_t frame_number, lldb_private::UnwindLLDB &unwind_lldb)
 ~RegisterContextUnwind () override=default
void InvalidateAllRegisters () override
size_t GetRegisterCount () override
const lldb_private::RegisterInfoGetRegisterInfoAtIndex (size_t reg) override
size_t GetRegisterSetCount () override
const lldb_private::RegisterSetGetRegisterSet (size_t reg_set) override
bool ReadRegister (const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue &value) override
bool WriteRegister (const lldb_private::RegisterInfo *reg_info, const lldb_private::RegisterValue &value) override
bool ReadAllRegisterValues (lldb::WritableDataBufferSP &data_sp) override
bool WriteAllRegisterValues (const lldb::DataBufferSP &data_sp) override
uint32_t ConvertRegisterKindToRegisterNumber (lldb::RegisterKind kind, uint32_t num) override
 Convert from a given register numbering scheme to the lldb register numbering scheme.
bool IsValid () const
bool IsTrapHandlerFrame () const
bool GetCFA (lldb::addr_t &cfa)
bool GetStartPC (lldb::addr_t &start_pc)
bool ReadPC (lldb::addr_t &start_pc)
bool BehavesLikeZerothFrame () const override
 Indicates that this frame is currently executing code, that the PC value is not a return-pc but an actual executing instruction.
Public Member Functions inherited from lldb_private::RegisterContext
 RegisterContext (Thread &thread, uint32_t concrete_frame_idx)
 ~RegisterContext () override
void InvalidateIfNeeded (bool force)
virtual lldb::ByteOrder GetByteOrder ()
virtual bool RegisterWriteCausesReconfigure (const llvm::StringRef name)
virtual bool ReconfigureRegisterInfo ()
virtual bool ReadAllRegisterValues (lldb_private::RegisterCheckpoint &reg_checkpoint)
virtual bool WriteAllRegisterValues (const lldb_private::RegisterCheckpoint &reg_checkpoint)
bool CopyFromRegisterContext (lldb::RegisterContextSP context)
virtual uint32_t NumSupportedHardwareBreakpoints ()
virtual uint32_t SetHardwareBreakpoint (lldb::addr_t addr, size_t size)
virtual bool ClearHardwareBreakpoint (uint32_t hw_idx)
virtual uint32_t NumSupportedHardwareWatchpoints ()
virtual uint32_t SetHardwareWatchpoint (lldb::addr_t addr, size_t size, bool read, bool write)
virtual bool ClearHardwareWatchpoint (uint32_t hw_index)
virtual bool HardwareSingleStep (bool enable)
virtual Status ReadRegisterValueFromMemory (const lldb_private::RegisterInfo *reg_info, lldb::addr_t src_addr, uint32_t src_len, RegisterValue &reg_value)
virtual Status WriteRegisterValueToMemory (const lldb_private::RegisterInfo *reg_info, lldb::addr_t dst_addr, uint32_t dst_len, const RegisterValue &reg_value)
virtual lldb::tid_t GetThreadID () const
virtual ThreadGetThread ()
const RegisterInfoGetRegisterInfoByName (llvm::StringRef reg_name, uint32_t start_idx=0)
const RegisterInfoGetRegisterInfo (lldb::RegisterKind reg_kind, uint32_t reg_num)
uint64_t GetPC (uint64_t fail_value=LLDB_INVALID_ADDRESS)
uint64_t GetThreadPointer (uint64_t fail_value=LLDB_INVALID_ADDRESS)
bool GetPCForSymbolication (Address &address)
 Get an address suitable for symbolication.
bool SetPC (uint64_t pc)
bool SetPC (Address addr)
uint64_t GetSP (uint64_t fail_value=LLDB_INVALID_ADDRESS)
bool SetSP (uint64_t sp)
uint64_t GetFP (uint64_t fail_value=LLDB_INVALID_ADDRESS)
bool SetFP (uint64_t fp)
const char * GetRegisterName (uint32_t reg)
uint64_t GetReturnAddress (uint64_t fail_value=LLDB_INVALID_ADDRESS)
uint64_t GetFlags (uint64_t fail_value=0)
uint64_t ReadRegisterAsUnsigned (uint32_t reg, uint64_t fail_value)
uint64_t ReadRegisterAsUnsigned (const RegisterInfo *reg_info, uint64_t fail_value)
bool WriteRegisterFromUnsigned (uint32_t reg, uint64_t uval)
bool WriteRegisterFromUnsigned (const RegisterInfo *reg_info, uint64_t uval)
bool ConvertBetweenRegisterKinds (lldb::RegisterKind source_rk, uint32_t source_regnum, lldb::RegisterKind target_rk, uint32_t &target_regnum)
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.
uint32_t GetStopID () const
void SetStopID (uint32_t stop_id)
Public Member Functions inherited from lldb_private::ExecutionContextScope
virtual ~ExecutionContextScope ()=default

Protected Member Functions

lldb_private::UnwindLLDB::RegisterSearchResult SavedLocationForRegister (uint32_t lldb_regnum, lldb_private::UnwindLLDB::ConcreteRegisterLocation &regloc)

Private Types

enum  FrameType {
  eNormalFrame , eTrapHandlerFrame , eDebuggerFrame , eSkipFrame ,
  eNotAValidFrame
}

Private Member Functions

bool CheckIfLoopingStack ()
bool IsFrameZero () const
void InitializeZerothFrame ()
void InitializeNonZerothFrame ()
SharedPtr GetNextFrame () const
SharedPtr GetPrevFrame () const
bool IsSkipFrame () const
bool IsTrapHandlerSymbol (lldb_private::Process *process, const lldb_private::SymbolContext &m_sym_ctx) const
 Determines if a SymbolContext is a trap handler or not.
void PropagateTrapHandlerFlagFromUnwindPlan (std::shared_ptr< const UnwindPlan > unwind_plan)
 Check if the given unwind plan indicates a signal trap handler, and update frame type and symbol context if so.
std::optional< UnwindPlan::Row::AbstractRegisterLocationGetAbstractRegisterLocation (uint32_t lldb_regnum, lldb::RegisterKind &kind)
bool ReadRegisterValueFromRegisterLocation (lldb_private::UnwindLLDB::ConcreteRegisterLocation regloc, const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue &value)
bool WriteRegisterValueToRegisterLocation (lldb_private::UnwindLLDB::ConcreteRegisterLocation regloc, const lldb_private::RegisterInfo *reg_info, const lldb_private::RegisterValue &value)
bool TryFallbackUnwindPlan ()
 If the unwind has to the caller frame has failed, try something else.
bool ForceSwitchToFallbackUnwindPlan ()
 Switch to the fallback unwind plan unconditionally without any safety checks that it is providing better results than the normal unwind plan.
bool ReadGPRValue (lldb::RegisterKind register_kind, uint32_t regnum, lldb::addr_t &value)
bool ReadGPRValue (const RegisterNumber &reg_num, lldb::addr_t &value)
bool ReadFrameAddress (lldb::RegisterKind register_kind, const UnwindPlan::Row::FAValue &fa, lldb::addr_t &address)
std::shared_ptr< const UnwindPlanGetFastUnwindPlanForFrame ()
std::shared_ptr< const UnwindPlanGetFullUnwindPlanForFrame ()
lldb::UnwindPlanSP TryAdoptArchitectureUnwindPlan ()
void UnwindLogMsg (const char *fmt,...) __attribute__((format(printf
void void UnwindLogMsgVerbose (const char *fmt,...) __attribute__((format(printf
void void bool IsUnwindPlanValidForCurrentPC (std::shared_ptr< const UnwindPlan > unwind_plan_sp)
lldb::addr_t GetReturnAddressHint (int32_t plan_offset)
 RegisterContextUnwind (const RegisterContextUnwind &)=delete
const RegisterContextUnwindoperator= (const RegisterContextUnwind &)=delete

Private Attributes

lldb_private::Threadm_thread
std::shared_ptr< const UnwindPlanm_fast_unwind_plan_sp
std::shared_ptr< const UnwindPlanm_full_unwind_plan_sp
std::shared_ptr< const UnwindPlanm_fallback_unwind_plan_sp
bool m_all_registers_available
int m_frame_type
lldb::addr_t m_cfa
lldb::addr_t m_afa
lldb_private::Address m_start_pc
lldb_private::Address m_current_pc
std::optional< int > m_current_offset
 How far into the function we've executed.
std::optional< int > m_current_offset_backed_up_one
bool m_behaves_like_zeroth_frame
lldb_private::SymbolContextm_sym_ctx
bool m_sym_ctx_valid
uint32_t m_frame_number
std::map< uint32_t, lldb_private::UnwindLLDB::ConcreteRegisterLocationm_registers
lldb_private::UnwindLLDBm_parent_unwind

Friends

class UnwindLLDB
class ArchitectureArm

Additional Inherited Members

Protected Attributes inherited from lldb_private::RegisterContext
Threadm_thread
uint32_t m_concrete_frame_idx
uint32_t m_stop_id

Detailed Description

Definition at line 26 of file RegisterContextUnwind.h.

Member Typedef Documentation

◆ SharedPtr

Member Enumeration Documentation

◆ FrameType

Enumerator
eNormalFrame 
eTrapHandlerFrame 
eDebuggerFrame 
eSkipFrame 
eNotAValidFrame 

Definition at line 96 of file RegisterContextUnwind.h.

Constructor & Destructor Documentation

◆ RegisterContextUnwind() [1/2]

◆ ~RegisterContextUnwind()

lldb_private::RegisterContextUnwind::~RegisterContextUnwind ( )
overridedefault

◆ RegisterContextUnwind() [2/2]

lldb_private::RegisterContextUnwind::RegisterContextUnwind ( const RegisterContextUnwind & )
privatedelete

Member Function Documentation

◆ BehavesLikeZerothFrame()

bool RegisterContextUnwind::BehavesLikeZerothFrame ( ) const
overridevirtual

Indicates that this frame is currently executing code, that the PC value is not a return-pc but an actual executing instruction.

Some places in lldb will treat a return-pc value differently than the currently-executing-pc value, and this method can indicate if that should be done. The base class implementation only uses the frame index, but subclasses may have additional information that they can use to detect frames in this state, for instance a frame above a trap handler (sigtramp etc)..

Reimplemented from lldb_private::RegisterContext.

Definition at line 736 of file RegisterContextUnwind.cpp.

References m_behaves_like_zeroth_frame, and m_frame_number.

Referenced by GetAbstractRegisterLocation(), and SavedLocationForRegister().

◆ CheckIfLoopingStack()

bool RegisterContextUnwind::CheckIfLoopingStack ( )
private

Definition at line 705 of file RegisterContextUnwind.cpp.

References GetNextFrame(), LLDB_INVALID_ADDRESS, and m_cfa.

Referenced by InitializeNonZerothFrame().

◆ ConvertRegisterKindToRegisterNumber()

uint32_t RegisterContextUnwind::ConvertRegisterKindToRegisterNumber ( lldb::RegisterKind kind,
uint32_t num )
overridevirtual

Convert from a given register numbering scheme to the lldb register numbering scheme.

There may be multiple ways to enumerate the registers for a given architecture. ABI references will specify one to be used with DWARF, the register numberings from process plugin, there may be a variation used for eh_frame unwind instructions (e.g. on Darwin), and so on. Register 5 by itself is meaningless - RegisterKind enumeration tells you what context that number should be translated as.

Inside lldb, register numbers are in the eRegisterKindLLDB scheme; arguments which take a register number should take one in that scheme.

eRegisterKindGeneric is a special numbering scheme which gives us constant values for the pc, frame register, stack register, etc., for use within lldb. They may not be defined for all architectures but it allows generic code to translate these common registers into the lldb numbering scheme.

This method translates a given register kind + register number into the eRegisterKindLLDB register numbering.

Parameters
[in]kindThe register numbering scheme (RegisterKind) that the following register number is in.
[in]numA register number in the 'kind' register numbering scheme.
Returns
The equivalent register number in the eRegisterKindLLDB numbering scheme, if possible, else LLDB_INVALID_REGNUM.

Reimplemented from lldb_private::RegisterContext.

Definition at line 1092 of file RegisterContextUnwind.cpp.

References m_thread.

◆ ForceSwitchToFallbackUnwindPlan()

bool RegisterContextUnwind::ForceSwitchToFallbackUnwindPlan ( )
private

Switch to the fallback unwind plan unconditionally without any safety checks that it is providing better results than the normal unwind plan.

The only time it is valid to call this method is if the full unwindplan is found to be fundamentally incorrect/impossible.

Returns true if it was able to install the fallback unwind plan.

Definition at line 1921 of file RegisterContextUnwind.cpp.

References lldb_private::UnwindPlan::Row::GetAFAValue(), lldb_private::UnwindPlan::Row::GetCFAValue(), lldb_private::UnwindPlan::Row::FAValue::GetValueType(), LLDB_INVALID_ADDRESS, m_afa, m_cfa, m_current_offset, m_fallback_unwind_plan_sp, m_full_unwind_plan_sp, m_registers, PropagateTrapHandlerFlagFromUnwindPlan(), ReadFrameAddress(), lldb_private::UnwindPlan::Row::FAValue::unspecified, and UnwindLogMsg().

◆ GetAbstractRegisterLocation()

◆ GetCFA()

bool RegisterContextUnwind::GetCFA ( lldb::addr_t & cfa)

◆ GetFastUnwindPlanForFrame()

std::shared_ptr< const UnwindPlan > RegisterContextUnwind::GetFastUnwindPlanForFrame ( )
private

◆ GetFullUnwindPlanForFrame()

◆ GetNextFrame()

◆ GetPrevFrame()

RegisterContextUnwind::SharedPtr RegisterContextUnwind::GetPrevFrame ( ) const
private

Definition at line 2369 of file RegisterContextUnwind.cpp.

References m_frame_number, and m_parent_unwind.

◆ GetRegisterCount()

size_t RegisterContextUnwind::GetRegisterCount ( )
overridevirtual

Implements lldb_private::RegisterContext.

Definition at line 1076 of file RegisterContextUnwind.cpp.

References m_thread.

◆ GetRegisterInfoAtIndex()

◆ GetRegisterSet()

const RegisterSet * RegisterContextUnwind::GetRegisterSet ( size_t reg_set)
overridevirtual

Implements lldb_private::RegisterContext.

Definition at line 1088 of file RegisterContextUnwind.cpp.

References m_thread.

◆ GetRegisterSetCount()

size_t RegisterContextUnwind::GetRegisterSetCount ( )
overridevirtual

Implements lldb_private::RegisterContext.

Definition at line 1084 of file RegisterContextUnwind.cpp.

References m_thread.

◆ GetReturnAddressHint()

lldb::addr_t RegisterContextUnwind::GetReturnAddressHint ( int32_t plan_offset)
private

◆ GetStartPC()

bool RegisterContextUnwind::GetStartPC ( lldb::addr_t & start_pc)

◆ InitializeNonZerothFrame()

void RegisterContextUnwind::InitializeNonZerothFrame ( )
private

Definition at line 310 of file RegisterContextUnwind.cpp.

References CheckIfLoopingStack(), lldb_private::UnwindPlan::Row::Dump(), eDebuggerFrame, eNormalFrame, eNotAValidFrame, lldb::eRegisterKindGeneric, eSkipFrame, eTrapHandlerFrame, lldb_private::Process::GetABI(), lldb_private::UnwindPlan::Row::GetAFAValue(), lldb_private::UnwindPlan::Row::GetCFAValue(), lldb_private::StreamString::GetData(), GetFastUnwindPlanForFrame(), GetFullUnwindPlanForFrame(), lldb_private::Process::GetLoadAddressPermissions(), lldb_private::GetLog(), GetNextFrame(), lldb_private::ExecutionContext::GetProcessPtr(), lldb_private::LanguageRuntime::GetRuntimeUnwindPlan(), GetSymbolOrFunctionName(), lldb_private::Process::GetTarget(), lldb_private::ExecutionContext::GetTargetPtr(), IsFrameZero(), IsTrapHandlerFrame(), IsTrapHandlerSymbol(), IsUnwindPlanValidForCurrentPC(), IsValid(), LLDB_INVALID_ADDRESS, LLDB_REGNUM_GENERIC_FP, LLDB_REGNUM_GENERIC_PC, LLDB_REGNUM_GENERIC_SP, m_afa, m_all_registers_available, m_behaves_like_zeroth_frame, m_cfa, m_current_offset, m_current_offset_backed_up_one, m_current_pc, m_fast_unwind_plan_sp, m_frame_type, m_full_unwind_plan_sp, m_start_pc, m_sym_ctx, m_sym_ctx_valid, m_thread, pc, PropagateTrapHandlerFlagFromUnwindPlan(), ReadFrameAddress(), ReadGPRValue(), lldb_private::Address::ResolveFunctionScope(), lldb_private::Address::SetLoadAddress(), TryAdoptArchitectureUnwindPlan(), TryFallbackUnwindPlan(), lldb_private::Unwind, and UnwindLogMsg().

Referenced by RegisterContextUnwind().

◆ InitializeZerothFrame()

◆ InvalidateAllRegisters()

void RegisterContextUnwind::InvalidateAllRegisters ( )
overridevirtual

Implements lldb_private::RegisterContext.

Definition at line 1072 of file RegisterContextUnwind.cpp.

References eNotAValidFrame, and m_frame_type.

◆ IsFrameZero()

◆ IsSkipFrame()

bool RegisterContextUnwind::IsSkipFrame ( ) const
private

Definition at line 1237 of file RegisterContextUnwind.cpp.

References eSkipFrame, and m_frame_type.

◆ IsTrapHandlerFrame()

bool RegisterContextUnwind::IsTrapHandlerFrame ( ) const

Definition at line 1225 of file RegisterContextUnwind.cpp.

References eTrapHandlerFrame, and m_frame_type.

Referenced by InitializeNonZerothFrame(), and ReadPC().

◆ IsTrapHandlerSymbol()

bool RegisterContextUnwind::IsTrapHandlerSymbol ( lldb_private::Process * process,
const lldb_private::SymbolContext & m_sym_ctx ) const
private

Determines if a SymbolContext is a trap handler or not.

Given a SymbolContext, determines if this is a trap handler function aka asynchronous signal handler.

Returns
Returns true if the SymbolContext is a trap handler.

Definition at line 1241 of file RegisterContextUnwind.cpp.

References lldb_private::Target::GetPlatform(), lldb_private::Process::GetTarget(), m_parent_unwind, and m_sym_ctx.

Referenced by InitializeNonZerothFrame(), and InitializeZerothFrame().

◆ IsUnwindPlanValidForCurrentPC()

bool RegisterContextUnwind::IsUnwindPlanValidForCurrentPC ( std::shared_ptr< const UnwindPlan > unwind_plan_sp)
private

◆ IsValid()

◆ operator=()

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

◆ PropagateTrapHandlerFlagFromUnwindPlan()

void RegisterContextUnwind::PropagateTrapHandlerFlagFromUnwindPlan ( std::shared_ptr< const UnwindPlan > unwind_plan)
private

◆ ReadAllRegisterValues()

bool RegisterContextUnwind::ReadAllRegisterValues ( lldb::WritableDataBufferSP & data_sp)
overridevirtual

Reimplemented from lldb_private::RegisterContext.

Definition at line 2338 of file RegisterContextUnwind.cpp.

◆ ReadFrameAddress()

bool RegisterContextUnwind::ReadFrameAddress ( lldb::RegisterKind register_kind,
const UnwindPlan::Row::FAValue & fa,
lldb::addr_t & address )
private

Definition at line 2017 of file RegisterContextUnwind.cpp.

References lldb_private::Status::AsCString(), lldb_private::RegisterInfo::byte_size, lldb::eRegisterKindLLDB, error(), lldb_private::DWARFExpressionList::Evaluate(), lldb_private::Status::Fail(), lldb_private::Process::GetAddressByteSize(), RegisterNumber::GetAsKind(), lldb_private::RegisterValue::GetAsUInt64(), lldb_private::Process::GetByteOrder(), lldb_private::UnwindPlan::Row::FAValue::GetConstant(), lldb_private::UnwindPlan::Row::FAValue::GetDWARFExpressionBytes(), lldb_private::UnwindPlan::Row::FAValue::GetDWARFExpressionLength(), lldb_private::Process::GetLoadAddressPermissions(), lldb_private::DWARFExpressionList::GetMutableExpressionAtAddress(), RegisterNumber::GetName(), lldb_private::UnwindPlan::Row::FAValue::GetOffset(), lldb_private::ExecutionContext::GetProcessPtr(), GetRegisterInfoAtIndex(), lldb_private::UnwindPlan::Row::FAValue::GetRegisterNumber(), GetReturnAddressHint(), lldb_private::UnwindPlan::Row::FAValue::GetValueType(), lldb_private::UnwindPlan::Row::FAValue::isConstant, lldb_private::UnwindPlan::Row::FAValue::isDWARFExpression, lldb_private::UnwindPlan::Row::FAValue::isRaSearch, lldb_private::UnwindPlan::Row::FAValue::isRegisterDereferenced, lldb_private::UnwindPlan::Row::FAValue::isRegisterPlusOffset, LLDB_INVALID_ADDRESS, m_thread, ReadGPRValue(), lldb_private::Process::ReadPointerFromMemory(), lldb_private::RegisterContext::ReadRegisterValueFromMemory(), lldb_private::DWARFExpression::SetRegisterKind(), and UnwindLogMsg().

Referenced by ForceSwitchToFallbackUnwindPlan(), InitializeNonZerothFrame(), InitializeZerothFrame(), and TryFallbackUnwindPlan().

◆ ReadGPRValue() [1/2]

bool RegisterContextUnwind::ReadGPRValue ( const RegisterNumber & reg_num,
lldb::addr_t & value )
private

◆ ReadGPRValue() [2/2]

◆ ReadPC()

◆ ReadRegister()

◆ ReadRegisterValueFromRegisterLocation()

bool RegisterContextUnwind::ReadRegisterValueFromRegisterLocation ( lldb_private::UnwindLLDB::ConcreteRegisterLocation regloc,
const lldb_private::RegisterInfo * reg_info,
lldb_private::RegisterValue & value )
private

Definition at line 1098 of file RegisterContextUnwind.cpp.

References lldb_private::RegisterInfo::byte_size, lldb_private::UnwindLLDB::ConcreteRegisterLocation::eRegisterInLiveRegisterContext, lldb_private::UnwindLLDB::ConcreteRegisterLocation::eRegisterInRegister, lldb_private::UnwindLLDB::ConcreteRegisterLocation::eRegisterIsRegisterPlusOffset, lldb_private::UnwindLLDB::ConcreteRegisterLocation::eRegisterNotSaved, lldb_private::UnwindLLDB::ConcreteRegisterLocation::eRegisterSavedAtHostMemoryLocation, lldb_private::UnwindLLDB::ConcreteRegisterLocation::eRegisterSavedAtMemoryLocation, lldb_private::UnwindLLDB::ConcreteRegisterLocation::eRegisterValueInferred, error(), lldb_private::RegisterValue::GetAsUInt64(), GetNextFrame(), GetRegisterInfoAtIndex(), lldb_private::UnwindLLDB::ConcreteRegisterLocation::inferred_value, IsFrameZero(), IsValid(), lldb_private::UnwindLLDB::ConcreteRegisterLocation::location, m_thread, lldb_private::UnwindLLDB::ConcreteRegisterLocation::offset, lldb_private::RegisterContext::ReadRegisterValueFromMemory(), lldb_private::UnwindLLDB::ConcreteRegisterLocation::reg_plus_offset, lldb_private::UnwindLLDB::ConcreteRegisterLocation::register_number, lldb_private::RegisterValue::SetUInt(), lldb_private::UnwindLLDB::ConcreteRegisterLocation::target_memory_location, lldb_private::UnwindLLDB::ConcreteRegisterLocation::type, and UnwindLogMsg().

Referenced by lldb_private::ArchitectureArm::GetArchitectureUnwindPlan(), ReadGPRValue(), ReadRegister(), and TryFallbackUnwindPlan().

◆ SavedLocationForRegister()

enum UnwindLLDB::RegisterSearchResult RegisterContextUnwind::SavedLocationForRegister ( uint32_t lldb_regnum,
lldb_private::UnwindLLDB::ConcreteRegisterLocation & regloc )
protected

Definition at line 1514 of file RegisterContextUnwind.cpp.

References BehavesLikeZerothFrame(), lldb_private::UnwindLLDB::eRegisterFound, lldb_private::UnwindLLDB::ConcreteRegisterLocation::eRegisterInLiveRegisterContext, lldb_private::UnwindLLDB::ConcreteRegisterLocation::eRegisterInRegister, lldb_private::UnwindLLDB::eRegisterIsVolatile, lldb::eRegisterKindGeneric, lldb::eRegisterKindLLDB, lldb_private::UnwindLLDB::eRegisterNotFound, lldb_private::UnwindLLDB::ConcreteRegisterLocation::eRegisterNotSaved, lldb_private::UnwindLLDB::ConcreteRegisterLocation::eRegisterSavedAtMemoryLocation, lldb_private::UnwindLLDB::ConcreteRegisterLocation::eRegisterValueInferred, lldb_private::DWARFExpressionList::Evaluate(), GetAbstractRegisterLocation(), lldb_private::Process::GetAddressByteSize(), RegisterNumber::GetAsKind(), lldb_private::Process::GetByteOrder(), lldb_private::GetLog(), lldb_private::DWARFExpressionList::GetMutableExpressionAtAddress(), RegisterNumber::GetName(), lldb_private::ExecutionContext::GetProcessPtr(), lldb_private::UnwindLLDB::ConcreteRegisterLocation::inferred_value, IsFrameZero(), LLDB_INVALID_ADDRESS, LLDB_INVALID_REGNUM, LLDB_LOG_ERROR, LLDB_REGNUM_GENERIC_PC, LLDB_REGNUM_GENERIC_RA, lldb_private::Value::LoadAddress, lldb_private::UnwindLLDB::ConcreteRegisterLocation::location, m_afa, m_cfa, m_registers, m_thread, lldb_private::UnwindLLDB::ConcreteRegisterLocation::register_number, lldb_private::DWARFExpression::SetRegisterKind(), lldb_private::Value::SetValueType(), lldb_private::UnwindLLDB::ConcreteRegisterLocation::target_memory_location, lldb_private::UnwindLLDB::ConcreteRegisterLocation::type, lldb_private::Unwind, and UnwindLogMsg().

Referenced by lldb_private::ArchitectureArm::GetArchitectureUnwindPlan(), and TryFallbackUnwindPlan().

◆ TryAdoptArchitectureUnwindPlan()

◆ TryFallbackUnwindPlan()

bool RegisterContextUnwind::TryFallbackUnwindPlan ( )
private

If the unwind has to the caller frame has failed, try something else.

If lldb is using an assembly language based UnwindPlan for a frame and the unwind to the caller frame fails, try falling back to a generic UnwindPlan (architecture default unwindplan) to see if that might work better. This is mostly helping to work around problems where the assembly language inspection fails on hand-written assembly code.

Returns
Returns true if a fallback unwindplan was found & was installed.

Definition at line 1781 of file RegisterContextUnwind.cpp.

References lldb_private::eLazyBoolYes, lldb_private::UnwindLLDB::eRegisterFound, lldb::eRegisterKindGeneric, lldb::eRegisterKindLLDB, lldb_private::UnwindPlan::Row::GetAFAValue(), RegisterNumber::GetAsKind(), lldb_private::RegisterValue::GetAsUInt64(), lldb_private::UnwindPlan::Row::GetCFAValue(), GetRegisterInfoAtIndex(), lldb_private::UnwindPlan::Row::FAValue::GetValueType(), LLDB_INVALID_ADDRESS, LLDB_REGNUM_GENERIC_PC, m_afa, m_cfa, m_current_offset_backed_up_one, m_fallback_unwind_plan_sp, m_full_unwind_plan_sp, m_registers, m_thread, PropagateTrapHandlerFlagFromUnwindPlan(), ReadFrameAddress(), ReadRegisterValueFromRegisterLocation(), SavedLocationForRegister(), lldb_private::UnwindPlan::Row::FAValue::unspecified, and UnwindLogMsg().

Referenced by InitializeNonZerothFrame(), and InitializeZerothFrame().

◆ UnwindLogMsg()

◆ UnwindLogMsgVerbose()

void RegisterContextUnwind::UnwindLogMsgVerbose ( const char * fmt,
... )
private

◆ WriteAllRegisterValues()

bool RegisterContextUnwind::WriteAllRegisterValues ( const lldb::DataBufferSP & data_sp)
overridevirtual

Reimplemented from lldb_private::RegisterContext.

Definition at line 2344 of file RegisterContextUnwind.cpp.

◆ WriteRegister()

◆ WriteRegisterValueToRegisterLocation()

◆ ArchitectureArm

◆ UnwindLLDB

friend class UnwindLLDB
friend

Definition at line 108 of file RegisterContextUnwind.h.

References UnwindLLDB.

Referenced by RegisterContextUnwind(), and UnwindLLDB.

Member Data Documentation

◆ m_afa

◆ m_all_registers_available

bool lldb_private::RegisterContextUnwind::m_all_registers_available
private

◆ m_behaves_like_zeroth_frame

bool lldb_private::RegisterContextUnwind::m_behaves_like_zeroth_frame
private

◆ m_cfa

◆ m_current_offset

std::optional<int> lldb_private::RegisterContextUnwind::m_current_offset
private

◆ m_current_offset_backed_up_one

std::optional<int> lldb_private::RegisterContextUnwind::m_current_offset_backed_up_one
private

◆ m_current_pc

◆ m_fallback_unwind_plan_sp

std::shared_ptr<const UnwindPlan> lldb_private::RegisterContextUnwind::m_fallback_unwind_plan_sp
private

◆ m_fast_unwind_plan_sp

std::shared_ptr<const UnwindPlan> lldb_private::RegisterContextUnwind::m_fast_unwind_plan_sp
private

◆ m_frame_number

uint32_t lldb_private::RegisterContextUnwind::m_frame_number
private

◆ m_frame_type

◆ m_full_unwind_plan_sp

std::shared_ptr<const UnwindPlan> lldb_private::RegisterContextUnwind::m_full_unwind_plan_sp
private

◆ m_parent_unwind

lldb_private::UnwindLLDB& lldb_private::RegisterContextUnwind::m_parent_unwind
private

◆ m_registers

◆ m_start_pc

◆ m_sym_ctx

◆ m_sym_ctx_valid

bool lldb_private::RegisterContextUnwind::m_sym_ctx_valid
private

◆ m_thread


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