LLDB mainline
|
#include <RegisterContextUnwind.h>
Public Types | |
typedef std::shared_ptr< RegisterContextUnwind > | SharedPtr |
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::RegisterInfo * | GetRegisterInfoAtIndex (size_t reg) override |
size_t | GetRegisterSetCount () override |
const lldb_private::RegisterSet * | GetRegisterSet (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 ®_checkpoint) |
virtual bool | WriteAllRegisterValues (const lldb_private::RegisterCheckpoint ®_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 ®_value) |
virtual Status | WriteRegisterValueToMemory (const lldb_private::RegisterInfo *reg_info, lldb::addr_t dst_addr, uint32_t dst_len, const RegisterValue ®_value) |
virtual lldb::tid_t | GetThreadID () const |
virtual Thread & | GetThread () |
const RegisterInfo * | GetRegisterInfoByName (llvm::StringRef reg_name, uint32_t start_idx=0) |
const RegisterInfo * | GetRegisterInfo (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 ®loc) |
Private Types | |
enum | FrameType { eNormalFrame , eTrapHandlerFrame , eDebuggerFrame , eSkipFrame , eNotAValidFrame } |
Private Attributes | |
lldb_private::Thread & | m_thread |
std::shared_ptr< const UnwindPlan > | m_fast_unwind_plan_sp |
std::shared_ptr< const UnwindPlan > | m_full_unwind_plan_sp |
std::shared_ptr< const UnwindPlan > | m_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::SymbolContext & | m_sym_ctx |
bool | m_sym_ctx_valid |
uint32_t | m_frame_number |
std::map< uint32_t, lldb_private::UnwindLLDB::ConcreteRegisterLocation > | m_registers |
lldb_private::UnwindLLDB & | m_parent_unwind |
Friends | |
class | UnwindLLDB |
class | ArchitectureArm |
Additional Inherited Members | |
Protected Attributes inherited from lldb_private::RegisterContext | |
Thread & | m_thread |
uint32_t | m_concrete_frame_idx |
uint32_t | m_stop_id |
Definition at line 26 of file RegisterContextUnwind.h.
typedef std::shared_ptr<RegisterContextUnwind> lldb_private::RegisterContextUnwind::SharedPtr |
Definition at line 28 of file RegisterContextUnwind.h.
|
private |
Enumerator | |
---|---|
eNormalFrame | |
eTrapHandlerFrame | |
eDebuggerFrame | |
eSkipFrame | |
eNotAValidFrame |
Definition at line 96 of file RegisterContextUnwind.h.
RegisterContextUnwind::RegisterContextUnwind | ( | lldb_private::Thread & | thread, |
const SharedPtr & | next_frame, | ||
lldb_private::SymbolContext & | sym_ctx, | ||
uint32_t | frame_number, | ||
lldb_private::UnwindLLDB & | unwind_lldb ) |
Definition at line 55 of file RegisterContextUnwind.cpp.
References eDebuggerFrame, eTrapHandlerFrame, InitializeNonZerothFrame(), InitializeZerothFrame(), IsFrameZero(), LLDB_INVALID_ADDRESS, 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_fallback_unwind_plan_sp, m_fast_unwind_plan_sp, m_frame_number, m_frame_type, m_full_unwind_plan_sp, m_parent_unwind, m_registers, m_start_pc, m_sym_ctx, m_sym_ctx_valid, m_thread, lldb_private::RegisterContext::RegisterContext(), and UnwindLLDB.
Referenced by operator=(), and RegisterContextUnwind().
|
overridedefault |
|
privatedelete |
References RegisterContextUnwind().
|
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().
|
private |
Definition at line 705 of file RegisterContextUnwind.cpp.
References GetNextFrame(), LLDB_INVALID_ADDRESS, and m_cfa.
Referenced by InitializeNonZerothFrame().
|
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.
[in] | kind | The register numbering scheme (RegisterKind) that the following register number is in. |
[in] | num | A register number in the 'kind' register numbering scheme. |
Reimplemented from lldb_private::RegisterContext.
Definition at line 1092 of file RegisterContextUnwind.cpp.
References m_thread.
|
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().
|
private |
Definition at line 1300 of file RegisterContextUnwind.cpp.
References BehavesLikeZerothFrame(), lldb_private::UnwindPlan::Row::Dump(), lldb::eRegisterKindGeneric, lldb::eRegisterKindLLDB, lldb_private::Process::GetABI(), RegisterNumber::GetAsKind(), lldb_private::StreamString::GetData(), lldb_private::ABI::GetFallbackRegisterLocation(), GetFullUnwindPlanForFrame(), lldb_private::GetLog(), RegisterNumber::GetName(), lldb_private::ExecutionContext::GetProcessPtr(), lldb_private::UnwindPlan::Row::GetRegisterInfo(), GetRegisterInfoAtIndex(), lldb_private::ExecutionContext::GetTargetPtr(), RegisterNumber::init(), lldb_private::UnwindPlan::Row::AbstractRegisterLocation::IsSame(), lldb_private::UnwindPlan::Row::AbstractRegisterLocation::IsUndefined(), RegisterNumber::IsValid(), LLDB_INVALID_REGNUM, LLDB_REGNUM_GENERIC_PC, LLDB_REGNUM_GENERIC_RA, m_current_offset, m_current_offset_backed_up_one, m_fast_unwind_plan_sp, m_full_unwind_plan_sp, m_start_pc, m_thread, lldb_private::UnwindPlan::Row::AbstractRegisterLocation::SetInRegister(), lldb_private::UnwindPlan::Row::AbstractRegisterLocation::SetSame(), lldb_private::Unwind, and UnwindLogMsg().
Referenced by SavedLocationForRegister().
bool RegisterContextUnwind::GetCFA | ( | lldb::addr_t & | cfa | ) |
Definition at line 2351 of file RegisterContextUnwind.cpp.
References IsValid(), LLDB_INVALID_ADDRESS, and m_cfa.
Referenced by lldb_private::ArchitectureArm::GetArchitectureUnwindPlan().
|
private |
Definition at line 756 of file RegisterContextUnwind.cpp.
References eDebuggerFrame, eNormalFrame, eTrapHandlerFrame, IsFrameZero(), m_current_pc, m_frame_type, m_sym_ctx, and m_thread.
Referenced by InitializeNonZerothFrame(), and InitializeZerothFrame().
|
private |
Definition at line 798 of file RegisterContextUnwind.cpp.
References lldb_private::DynamicLoader::AlwaysRelyOnEHUnwindInfo(), lldb_private::ABI::CreateDefaultUnwindPlan(), lldb_private::ABI::CreateFunctionEntryUnwindPlan(), eDebuggerFrame, lldb_private::eLazyBoolNo, lldb_private::eLazyBoolYes, eNormalFrame, lldb::eRegisterKindGeneric, eTrapHandlerFrame, lldb_private::Process::GetABI(), lldb_private::Target::GetArchitecture(), lldb_private::Process::GetDynamicLoader(), lldb_private::Process::GetLoadAddressPermissions(), GetNextFrame(), lldb_private::Target::GetPlatform(), lldb_private::ExecutionContext::GetProcessPtr(), GetSymbolOrFunctionName(), lldb_private::Process::GetTarget(), lldb_private::ExecutionContext::GetTargetPtr(), lldb_private::ExecutionContext::GetTargetRef(), lldb_private::ArchSpec::GetTriple(), lldb_private::ArmUnwindInfo::GetUnwindPlan(), lldb_private::CallFrameInfo::GetUnwindPlan(), IsFrameZero(), IsUnwindPlanValidForCurrentPC(), m_all_registers_available, m_behaves_like_zeroth_frame, m_current_offset, m_current_pc, m_fallback_unwind_plan_sp, m_fast_unwind_plan_sp, m_frame_type, m_sym_ctx, m_sym_ctx_valid, m_thread, UnwindLogMsg(), and UnwindLogMsgVerbose().
Referenced by GetAbstractRegisterLocation(), InitializeNonZerothFrame(), and InitializeZerothFrame().
|
private |
Definition at line 2362 of file RegisterContextUnwind.cpp.
References m_frame_number, and m_parent_unwind.
Referenced by CheckIfLoopingStack(), GetFullUnwindPlanForFrame(), GetReturnAddressHint(), InitializeNonZerothFrame(), ReadPC(), ReadRegisterValueFromRegisterLocation(), and WriteRegisterValueToRegisterLocation().
|
private |
Definition at line 2369 of file RegisterContextUnwind.cpp.
References m_frame_number, and m_parent_unwind.
|
overridevirtual |
Implements lldb_private::RegisterContext.
Definition at line 1076 of file RegisterContextUnwind.cpp.
References m_thread.
|
overridevirtual |
Implements lldb_private::RegisterContext.
Definition at line 1080 of file RegisterContextUnwind.cpp.
References m_thread.
Referenced by GetAbstractRegisterLocation(), lldb_private::ArchitectureArm::GetArchitectureUnwindPlan(), ReadFrameAddress(), ReadGPRValue(), ReadRegisterValueFromRegisterLocation(), TryFallbackUnwindPlan(), and WriteRegisterValueToRegisterLocation().
|
overridevirtual |
Implements lldb_private::RegisterContext.
Definition at line 1088 of file RegisterContextUnwind.cpp.
References m_thread.
|
overridevirtual |
Implements lldb_private::RegisterContext.
Definition at line 1084 of file RegisterContextUnwind.cpp.
References m_thread.
|
private |
Definition at line 2148 of file RegisterContextUnwind.cpp.
References lldb::eRegisterKindGeneric, GetNextFrame(), LLDB_INVALID_ADDRESS, LLDB_REGNUM_GENERIC_SP, m_sym_ctx, m_thread, ReadGPRValue(), and UnwindLogMsgVerbose().
Referenced by ArchitectureArm, and ReadFrameAddress().
bool RegisterContextUnwind::GetStartPC | ( | lldb::addr_t & | start_pc | ) |
Definition at line 2376 of file RegisterContextUnwind.cpp.
References lldb_private::RegisterContext::CalculateTarget(), IsValid(), m_start_pc, m_thread, and ReadPC().
|
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().
|
private |
Definition at line 115 of file RegisterContextUnwind.cpp.
References lldb_private::UnwindPlan::Row::Dump(), eNormalFrame, eNotAValidFrame, lldb::eRegisterKindGeneric, eTrapHandlerFrame, lldb_private::Process::GetABI(), lldb_private::UnwindPlan::Row::GetAFAValue(), lldb_private::UnwindPlan::Row::GetCFAValue(), lldb_private::StreamString::GetData(), GetFastUnwindPlanForFrame(), GetFullUnwindPlanForFrame(), lldb_private::GetLog(), lldb_private::ExecutionContext::GetProcessPtr(), lldb_private::LanguageRuntime::GetRuntimeUnwindPlan(), GetSymbolOrFunctionName(), lldb_private::Process::GetTarget(), lldb_private::ExecutionContext::GetTargetPtr(), IsTrapHandlerSymbol(), LLDB_INVALID_ADDRESS, m_afa, m_behaves_like_zeroth_frame, m_cfa, m_current_offset, m_current_offset_backed_up_one, m_current_pc, m_fallback_unwind_plan_sp, 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, PropagateTrapHandlerFlagFromUnwindPlan(), ReadFrameAddress(), TryAdoptArchitectureUnwindPlan(), TryFallbackUnwindPlan(), lldb_private::Unwind, and UnwindLogMsg().
Referenced by RegisterContextUnwind().
|
overridevirtual |
Implements lldb_private::RegisterContext.
Definition at line 1072 of file RegisterContextUnwind.cpp.
References eNotAValidFrame, and m_frame_type.
|
private |
Definition at line 734 of file RegisterContextUnwind.cpp.
References m_frame_number.
Referenced by GetFastUnwindPlanForFrame(), GetFullUnwindPlanForFrame(), InitializeNonZerothFrame(), ReadGPRValue(), ReadRegister(), ReadRegisterValueFromRegisterLocation(), RegisterContextUnwind(), SavedLocationForRegister(), WriteRegister(), and WriteRegisterValueToRegisterLocation().
|
private |
Definition at line 1237 of file RegisterContextUnwind.cpp.
References eSkipFrame, and m_frame_type.
bool RegisterContextUnwind::IsTrapHandlerFrame | ( | ) | const |
Definition at line 1225 of file RegisterContextUnwind.cpp.
References eTrapHandlerFrame, and m_frame_type.
Referenced by InitializeNonZerothFrame(), and ReadPC().
|
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.
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().
|
private |
Definition at line 86 of file RegisterContextUnwind.cpp.
References m_current_offset, m_current_pc, and lldb_private::Address::SetOffset().
Referenced by ArchitectureArm, GetFullUnwindPlanForFrame(), and InitializeNonZerothFrame().
bool RegisterContextUnwind::IsValid | ( | ) | const |
Definition at line 1215 of file RegisterContextUnwind.cpp.
References eNotAValidFrame, and m_frame_type.
Referenced by GetCFA(), GetStartPC(), InitializeNonZerothFrame(), ReadGPRValue(), ReadPC(), ReadRegister(), ReadRegisterValueFromRegisterLocation(), WriteRegister(), and WriteRegisterValueToRegisterLocation().
|
privatedelete |
References RegisterContextUnwind().
|
private |
Check if the given unwind plan indicates a signal trap handler, and update frame type and symbol context if so.
Definition at line 1968 of file RegisterContextUnwind.cpp.
References lldb_private::eLazyBoolYes, eNormalFrame, eTrapHandlerFrame, lldb_private::ExecutionContext::GetProcessPtr(), GetSymbolOrFunctionName(), lldb_private::Process::GetTarget(), m_current_offset, m_current_offset_backed_up_one, m_current_pc, m_frame_type, m_start_pc, m_sym_ctx, m_sym_ctx_valid, m_thread, and UnwindLogMsg().
Referenced by ForceSwitchToFallbackUnwindPlan(), InitializeNonZerothFrame(), InitializeZerothFrame(), TryAdoptArchitectureUnwindPlan(), and TryFallbackUnwindPlan().
|
overridevirtual |
Reimplemented from lldb_private::RegisterContext.
Definition at line 2338 of file RegisterContextUnwind.cpp.
|
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().
|
private |
Definition at line 2263 of file RegisterContextUnwind.cpp.
References RegisterNumber::GetRegisterKind(), RegisterNumber::GetRegisterNumber(), and ReadGPRValue().
|
private |
Definition at line 2191 of file RegisterContextUnwind.cpp.
References lldb::eRegisterKindGeneric, lldb::eRegisterKindLLDB, lldb_private::RegisterValue::GetAsUInt64(), GetRegisterInfoAtIndex(), IsFrameZero(), IsValid(), LLDB_INVALID_REGNUM, LLDB_REGNUM_GENERIC_FP, LLDB_REGNUM_GENERIC_PC, LLDB_REGNUM_GENERIC_RA, LLDB_REGNUM_GENERIC_SP, m_frame_number, m_parent_unwind, m_thread, ReadRegisterValueFromRegisterLocation(), and UnwindLogMsg().
Referenced by GetReturnAddressHint(), InitializeNonZerothFrame(), ReadFrameAddress(), ReadGPRValue(), and ReadPC().
bool RegisterContextUnwind::ReadPC | ( | lldb::addr_t & | start_pc | ) |
Definition at line 2399 of file RegisterContextUnwind.cpp.
References lldb::eRegisterKindGeneric, GetNextFrame(), IsTrapHandlerFrame(), IsValid(), LLDB_REGNUM_GENERIC_PC, m_all_registers_available, m_thread, pc, and ReadGPRValue().
Referenced by GetStartPC().
|
overridevirtual |
Implements lldb_private::RegisterContext.
Definition at line 2271 of file RegisterContextUnwind.cpp.
References lldb::eRegisterKindGeneric, lldb::eRegisterKindLLDB, lldb_private::RegisterValue::eTypeUInt64, lldb_private::RegisterValue::GetAsUInt64(), lldb_private::RegisterValue::GetType(), IsFrameZero(), IsValid(), lldb_private::RegisterInfo::kinds, LLDB_INVALID_ADDRESS, LLDB_REGNUM_GENERIC_PC, LLDB_REGNUM_GENERIC_RA, m_frame_number, m_parent_unwind, m_thread, ReadRegisterValueFromRegisterLocation(), and UnwindLogMsgVerbose().
|
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().
|
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().
|
private |
Definition at line 1729 of file RegisterContextUnwind.cpp.
References lldb_private::UnwindPlan::Row::Dump(), lldb_private::StreamString::GetData(), lldb_private::GetLog(), m_current_offset, m_full_unwind_plan_sp, m_registers, m_start_pc, m_thread, PropagateTrapHandlerFlagFromUnwindPlan(), lldb_private::Unwind, and UnwindLogMsg().
Referenced by InitializeNonZerothFrame(), and InitializeZerothFrame().
|
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.
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().
|
private |
Definition at line 2426 of file RegisterContextUnwind.cpp.
References lldb_private::GetLog(), LLDB_LOGF, m_frame_number, m_thread, lldb_private::Unwind, and lldb_private::VASprintf().
Referenced by ForceSwitchToFallbackUnwindPlan(), GetAbstractRegisterLocation(), GetFullUnwindPlanForFrame(), InitializeNonZerothFrame(), InitializeZerothFrame(), PropagateTrapHandlerFlagFromUnwindPlan(), ReadFrameAddress(), ReadGPRValue(), ReadRegisterValueFromRegisterLocation(), SavedLocationForRegister(), TryAdoptArchitectureUnwindPlan(), and TryFallbackUnwindPlan().
|
private |
Definition at line 2443 of file RegisterContextUnwind.cpp.
References lldb_private::GetLog(), lldb_private::Log::GetVerbose(), LLDB_LOGF, m_frame_number, m_thread, lldb_private::Unwind, and lldb_private::VASprintf().
Referenced by ArchitectureArm, GetFullUnwindPlanForFrame(), GetReturnAddressHint(), ReadRegister(), and WriteRegister().
|
overridevirtual |
Reimplemented from lldb_private::RegisterContext.
Definition at line 2344 of file RegisterContextUnwind.cpp.
|
overridevirtual |
Implements lldb_private::RegisterContext.
Definition at line 2312 of file RegisterContextUnwind.cpp.
References lldb::eRegisterKindLLDB, IsFrameZero(), IsValid(), lldb_private::RegisterInfo::kinds, m_frame_number, m_parent_unwind, m_thread, UnwindLogMsgVerbose(), and WriteRegisterValueToRegisterLocation().
|
private |
Definition at line 1172 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(), GetNextFrame(), GetRegisterInfoAtIndex(), IsFrameZero(), IsValid(), lldb_private::UnwindLLDB::ConcreteRegisterLocation::location, m_thread, lldb_private::UnwindLLDB::ConcreteRegisterLocation::register_number, lldb_private::UnwindLLDB::ConcreteRegisterLocation::target_memory_location, lldb_private::UnwindLLDB::ConcreteRegisterLocation::type, and lldb_private::RegisterContext::WriteRegisterValueToMemory().
Referenced by WriteRegister().
|
friend |
Definition at line 110 of file RegisterContextUnwind.h.
References ArchitectureArm, GetReturnAddressHint(), IsUnwindPlanValidForCurrentPC(), m_sym_ctx, and UnwindLogMsgVerbose().
Referenced by ArchitectureArm.
|
friend |
Definition at line 108 of file RegisterContextUnwind.h.
References UnwindLLDB.
Referenced by RegisterContextUnwind(), and UnwindLLDB.
|
private |
Definition at line 235 of file RegisterContextUnwind.h.
Referenced by ForceSwitchToFallbackUnwindPlan(), InitializeNonZerothFrame(), InitializeZerothFrame(), RegisterContextUnwind(), SavedLocationForRegister(), and TryFallbackUnwindPlan().
|
private |
Definition at line 230 of file RegisterContextUnwind.h.
Referenced by GetFullUnwindPlanForFrame(), InitializeNonZerothFrame(), ReadPC(), and RegisterContextUnwind().
|
private |
Definition at line 251 of file RegisterContextUnwind.h.
Referenced by BehavesLikeZerothFrame(), GetFullUnwindPlanForFrame(), InitializeNonZerothFrame(), InitializeZerothFrame(), and RegisterContextUnwind().
|
private |
Definition at line 234 of file RegisterContextUnwind.h.
Referenced by CheckIfLoopingStack(), ForceSwitchToFallbackUnwindPlan(), GetCFA(), InitializeNonZerothFrame(), InitializeZerothFrame(), RegisterContextUnwind(), SavedLocationForRegister(), and TryFallbackUnwindPlan().
|
private |
How far into the function we've executed.
0 if no instructions have been executed yet, std::nullopt if unknown.
Definition at line 241 of file RegisterContextUnwind.h.
Referenced by ForceSwitchToFallbackUnwindPlan(), GetAbstractRegisterLocation(), GetFullUnwindPlanForFrame(), InitializeNonZerothFrame(), InitializeZerothFrame(), IsUnwindPlanValidForCurrentPC(), PropagateTrapHandlerFlagFromUnwindPlan(), RegisterContextUnwind(), and TryAdoptArchitectureUnwindPlan().
|
private |
Definition at line 249 of file RegisterContextUnwind.h.
Referenced by GetAbstractRegisterLocation(), InitializeNonZerothFrame(), InitializeZerothFrame(), PropagateTrapHandlerFlagFromUnwindPlan(), RegisterContextUnwind(), and TryFallbackUnwindPlan().
|
private |
Definition at line 237 of file RegisterContextUnwind.h.
Referenced by GetFastUnwindPlanForFrame(), GetFullUnwindPlanForFrame(), InitializeNonZerothFrame(), InitializeZerothFrame(), IsUnwindPlanValidForCurrentPC(), PropagateTrapHandlerFlagFromUnwindPlan(), and RegisterContextUnwind().
|
private |
Definition at line 228 of file RegisterContextUnwind.h.
Referenced by ForceSwitchToFallbackUnwindPlan(), GetFullUnwindPlanForFrame(), InitializeZerothFrame(), RegisterContextUnwind(), and TryFallbackUnwindPlan().
|
private |
Definition at line 226 of file RegisterContextUnwind.h.
Referenced by GetAbstractRegisterLocation(), GetFullUnwindPlanForFrame(), InitializeNonZerothFrame(), InitializeZerothFrame(), and RegisterContextUnwind().
|
private |
Definition at line 257 of file RegisterContextUnwind.h.
Referenced by BehavesLikeZerothFrame(), GetNextFrame(), GetPrevFrame(), IsFrameZero(), ReadGPRValue(), ReadRegister(), RegisterContextUnwind(), UnwindLogMsg(), UnwindLogMsgVerbose(), and WriteRegister().
|
private |
Definition at line 232 of file RegisterContextUnwind.h.
Referenced by GetFastUnwindPlanForFrame(), GetFullUnwindPlanForFrame(), InitializeNonZerothFrame(), InitializeZerothFrame(), InvalidateAllRegisters(), IsSkipFrame(), IsTrapHandlerFrame(), IsValid(), PropagateTrapHandlerFlagFromUnwindPlan(), and RegisterContextUnwind().
|
private |
Definition at line 227 of file RegisterContextUnwind.h.
Referenced by ForceSwitchToFallbackUnwindPlan(), GetAbstractRegisterLocation(), InitializeNonZerothFrame(), InitializeZerothFrame(), RegisterContextUnwind(), TryAdoptArchitectureUnwindPlan(), and TryFallbackUnwindPlan().
|
private |
Definition at line 262 of file RegisterContextUnwind.h.
Referenced by GetNextFrame(), GetPrevFrame(), IsTrapHandlerSymbol(), ReadGPRValue(), ReadRegister(), RegisterContextUnwind(), and WriteRegister().
|
private |
Definition at line 260 of file RegisterContextUnwind.h.
Referenced by ForceSwitchToFallbackUnwindPlan(), RegisterContextUnwind(), SavedLocationForRegister(), TryAdoptArchitectureUnwindPlan(), and TryFallbackUnwindPlan().
|
private |
Definition at line 236 of file RegisterContextUnwind.h.
Referenced by GetAbstractRegisterLocation(), GetStartPC(), InitializeNonZerothFrame(), InitializeZerothFrame(), PropagateTrapHandlerFlagFromUnwindPlan(), RegisterContextUnwind(), and TryAdoptArchitectureUnwindPlan().
|
private |
Definition at line 253 of file RegisterContextUnwind.h.
Referenced by ArchitectureArm, GetFastUnwindPlanForFrame(), GetFullUnwindPlanForFrame(), GetReturnAddressHint(), InitializeNonZerothFrame(), InitializeZerothFrame(), IsTrapHandlerSymbol(), PropagateTrapHandlerFlagFromUnwindPlan(), and RegisterContextUnwind().
|
private |
Definition at line 254 of file RegisterContextUnwind.h.
Referenced by GetFullUnwindPlanForFrame(), InitializeNonZerothFrame(), InitializeZerothFrame(), PropagateTrapHandlerFlagFromUnwindPlan(), and RegisterContextUnwind().
|
private |
Definition at line 218 of file RegisterContextUnwind.h.
Referenced by ConvertRegisterKindToRegisterNumber(), GetAbstractRegisterLocation(), GetFastUnwindPlanForFrame(), GetFullUnwindPlanForFrame(), GetRegisterCount(), GetRegisterInfoAtIndex(), GetRegisterSet(), GetRegisterSetCount(), GetReturnAddressHint(), GetStartPC(), InitializeNonZerothFrame(), InitializeZerothFrame(), PropagateTrapHandlerFlagFromUnwindPlan(), ReadFrameAddress(), ReadGPRValue(), ReadPC(), ReadRegister(), ReadRegisterValueFromRegisterLocation(), RegisterContextUnwind(), SavedLocationForRegister(), TryAdoptArchitectureUnwindPlan(), TryFallbackUnwindPlan(), UnwindLogMsg(), UnwindLogMsgVerbose(), WriteRegister(), and WriteRegisterValueToRegisterLocation().