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 void | InvalidateAllRegisters ()=0 |
virtual size_t | GetRegisterCount ()=0 |
virtual const RegisterInfo * | GetRegisterInfoAtIndex (size_t reg)=0 |
virtual size_t | GetRegisterSetCount ()=0 |
virtual const RegisterSet * | GetRegisterSet (size_t reg_set)=0 |
virtual lldb::ByteOrder | GetByteOrder () |
virtual bool | ReadRegister (const RegisterInfo *reg_info, RegisterValue ®_value)=0 |
virtual bool | WriteRegister (const RegisterInfo *reg_info, const RegisterValue ®_value)=0 |
virtual bool | ReadAllRegisterValues (lldb::WritableDataBufferSP &data_sp) |
virtual bool | WriteAllRegisterValues (const lldb::DataBufferSP &data_sp) |
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 | ConvertRegisterKindToRegisterNumber (lldb::RegisterKind kind, uint32_t num) |
Convert from a given register numbering scheme to the lldb register numbering scheme. | |
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 |
virtual lldb::TargetSP | CalculateTarget ()=0 |
virtual lldb::ProcessSP | CalculateProcess ()=0 |
virtual lldb::ThreadSP | CalculateThread ()=0 |
virtual lldb::StackFrameSP | CalculateStackFrame ()=0 |
virtual void | CalculateExecutionContext (ExecutionContext &exe_ctx)=0 |
Reconstruct the object's execution context into sc. | |
Private Types | |
enum | FrameType { eNormalFrame , eTrapHandlerFrame , eDebuggerFrame , eSkipFrame , eNotAValidFrame } |
Friends | |
class | UnwindLLDB |
Additional Inherited Members | |
virtual bool | BehavesLikeZerothFrame () const |
Indicates that this frame is currently executing code, that the PC value is not a return-pc but an actual executing instruction. | |
Protected Attributes inherited from lldb_private::RegisterContext | |
Thread & | m_thread |
uint32_t | m_concrete_frame_idx |
uint32_t | m_stop_id |
Definition at line 25 of file RegisterContextUnwind.h.
typedef std::shared_ptr<RegisterContextUnwind> lldb_private::RegisterContextUnwind::SharedPtr |
Definition at line 27 of file RegisterContextUnwind.h.
|
private |
Enumerator | |
---|---|
eNormalFrame | |
eTrapHandlerFrame | |
eDebuggerFrame | |
eSkipFrame | |
eNotAValidFrame |
Definition at line 76 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 lldb_private::SymbolContext::Clear(), eDebuggerFrame, eTrapHandlerFrame, InitializeNonZerothFrame(), InitializeZerothFrame(), IsFrameZero(), m_all_registers_available, m_sym_ctx, and m_sym_ctx_valid.
|
overridedefault |
|
privatedelete |
|
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 734 of file RegisterContextUnwind.cpp.
References m_behaves_like_zeroth_frame, and m_frame_number.
|
private |
Definition at line 703 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 1104 of file RegisterContextUnwind.cpp.
References lldb_private::Thread::GetRegisterContext(), and 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 1875 of file RegisterContextUnwind.cpp.
References 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().
Referenced by SavedLocationForRegister().
bool RegisterContextUnwind::GetCFA | ( | lldb::addr_t & | cfa | ) |
Definition at line 2306 of file RegisterContextUnwind.cpp.
References IsValid(), LLDB_INVALID_ADDRESS, and m_cfa.
|
private |
Definition at line 753 of file RegisterContextUnwind.cpp.
References lldb_private::Thread::CalculateTarget(), eDebuggerFrame, eNormalFrame, eTrapHandlerFrame, lldb_private::Address::GetModule(), IsFrameZero(), lldb_private::Address::IsValid(), m_current_pc, m_frame_type, m_sym_ctx, and m_thread.
Referenced by InitializeNonZerothFrame(), and InitializeZerothFrame().
|
private |
Definition at line 797 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::SymbolContext::function, lldb_private::Process::GetABI(), lldb_private::Target::GetArchitecture(), lldb_private::Process::GetDynamicLoader(), lldb_private::Address::GetLoadAddress(), lldb_private::Process::GetLoadAddressPermissions(), lldb_private::Address::GetModule(), 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::DWARFCallFrameInfo::GetUnwindPlan(), lldb_private::CallFrameInfo::GetUnwindPlan(), lldb_private::ArmUnwindInfo::GetUnwindPlan(), IsFrameZero(), IsUnwindPlanValidForCurrentPC(), lldb_private::Address::IsValid(), 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, lldb_private::SymbolContext::symbol, UnwindLogMsg(), and UnwindLogMsgVerbose().
Referenced by InitializeNonZerothFrame(), InitializeZerothFrame(), and SavedLocationForRegister().
|
private |
Definition at line 2317 of file RegisterContextUnwind.cpp.
References lldb_private::UnwindLLDB::GetRegisterContextForFrameNum(), m_frame_number, and m_parent_unwind.
Referenced by CheckIfLoopingStack(), GetFullUnwindPlanForFrame(), GetReturnAddressHint(), InitializeNonZerothFrame(), ReadPC(), ReadRegisterValueFromRegisterLocation(), and WriteRegisterValueToRegisterLocation().
|
private |
Definition at line 2324 of file RegisterContextUnwind.cpp.
References lldb_private::UnwindLLDB::GetRegisterContextForFrameNum(), m_frame_number, and m_parent_unwind.
|
overridevirtual |
Implements lldb_private::RegisterContext.
Definition at line 1088 of file RegisterContextUnwind.cpp.
References lldb_private::Thread::GetRegisterContext(), and m_thread.
|
overridevirtual |
Implements lldb_private::RegisterContext.
Definition at line 1092 of file RegisterContextUnwind.cpp.
References lldb_private::Thread::GetRegisterContext(), and m_thread.
Referenced by ReadFrameAddress(), ReadGPRValue(), ReadRegisterValueFromRegisterLocation(), SavedLocationForRegister(), TryFallbackUnwindPlan(), and WriteRegisterValueToRegisterLocation().
|
overridevirtual |
Implements lldb_private::RegisterContext.
Definition at line 1100 of file RegisterContextUnwind.cpp.
References lldb_private::Thread::GetRegisterContext(), and m_thread.
|
overridevirtual |
Implements lldb_private::RegisterContext.
Definition at line 1096 of file RegisterContextUnwind.cpp.
References lldb_private::Thread::GetRegisterContext(), and m_thread.
|
private |
Definition at line 2103 of file RegisterContextUnwind.cpp.
References lldb::eRegisterKindGeneric, GetNextFrame(), lldb_private::Thread::GetProcess(), LLDB_INVALID_ADDRESS, LLDB_REGNUM_GENERIC_SP, m_sym_ctx, m_thread, lldb_private::SymbolContext::module_sp, ReadGPRValue(), lldb_private::SymbolContext::symbol, and UnwindLogMsgVerbose().
Referenced by ReadFrameAddress().
bool RegisterContextUnwind::GetStartPC | ( | lldb::addr_t & | start_pc | ) |
Definition at line 2331 of file RegisterContextUnwind.cpp.
References lldb_private::RegisterContext::CalculateTarget(), lldb_private::Address::GetLoadAddress(), lldb_private::Thread::GetProcess(), lldb_private::Address::IsValid(), IsValid(), m_start_pc, m_thread, and ReadPC().
|
private |
Definition at line 311 of file RegisterContextUnwind.cpp.
References CheckIfLoopingStack(), lldb_private::SymbolContext::Clear(), eDebuggerFrame, eNormalFrame, eNotAValidFrame, lldb::eRegisterKindGeneric, eSkipFrame, eTrapHandlerFrame, lldb_private::SymbolContext::function, lldb_private::Process::GetABI(), lldb_private::AddressRange::GetBaseAddress(), lldb_private::StreamString::GetData(), GetFastUnwindPlanForFrame(), GetFullUnwindPlanForFrame(), lldb_private::Address::GetLoadAddress(), lldb_private::Process::GetLoadAddressPermissions(), lldb_private::GetLog(), lldb_private::Address::GetModule(), GetNextFrame(), lldb_private::Address::GetOffset(), lldb_private::ExecutionContext::GetProcessPtr(), lldb_private::Thread::GetRegisterContext(), lldb_private::LanguageRuntime::GetRuntimeUnwindPlan(), lldb_private::Address::GetSection(), GetSymbolOrFunctionName(), lldb_private::Process::GetTarget(), lldb_private::ExecutionContext::GetTargetPtr(), IsFrameZero(), IsTrapHandlerFrame(), IsTrapHandlerSymbol(), IsUnwindPlanValidForCurrentPC(), lldb_private::Address::IsValid(), 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(), lldb_private::SymbolContext::symbol, TryFallbackUnwindPlan(), lldb_private::Unwind, and UnwindLogMsg().
Referenced by RegisterContextUnwind().
|
private |
Definition at line 114 of file RegisterContextUnwind.cpp.
References eNormalFrame, eNotAValidFrame, lldb::eRegisterKindGeneric, eTrapHandlerFrame, lldb_private::Process::FixCodeAddress(), lldb_private::SymbolContext::function, lldb_private::Process::GetABI(), lldb_private::AddressRange::GetBaseAddress(), lldb_private::StreamString::GetData(), GetFastUnwindPlanForFrame(), lldb_private::Address::GetFileAddress(), GetFullUnwindPlanForFrame(), lldb_private::Address::GetLoadAddress(), lldb_private::GetLog(), lldb_private::Address::GetModule(), lldb_private::Address::GetOffset(), lldb_private::ExecutionContext::GetProcessPtr(), lldb_private::Thread::GetRegisterContext(), lldb_private::LanguageRuntime::GetRuntimeUnwindPlan(), lldb_private::Address::GetSection(), GetSymbolOrFunctionName(), lldb_private::Process::GetTarget(), lldb_private::ExecutionContext::GetTargetPtr(), IsTrapHandlerSymbol(), lldb_private::Address::IsValid(), 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, ReadFrameAddress(), lldb_private::Address::ResolveFunctionScope(), lldb_private::Address::SetLoadAddress(), lldb_private::SymbolContext::symbol, TryFallbackUnwindPlan(), lldb_private::Unwind, and UnwindLogMsg().
Referenced by RegisterContextUnwind().
|
overridevirtual |
Implements lldb_private::RegisterContext.
Definition at line 1084 of file RegisterContextUnwind.cpp.
References eNotAValidFrame, and m_frame_type.
|
private |
Definition at line 732 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 1227 of file RegisterContextUnwind.cpp.
References eSkipFrame, and m_frame_type.
bool RegisterContextUnwind::IsTrapHandlerFrame | ( | ) | const |
Definition at line 1215 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 1231 of file RegisterContextUnwind.cpp.
References lldb_private::SymbolContext::function, lldb_private::Function::GetName(), lldb_private::Symbol::GetName(), lldb_private::Target::GetPlatform(), lldb_private::Process::GetTarget(), lldb_private::UnwindLLDB::GetUserSpecifiedTrapHandlerFunctionNames(), m_parent_unwind, m_sym_ctx, and lldb_private::SymbolContext::symbol.
Referenced by InitializeNonZerothFrame(), and InitializeZerothFrame().
|
private |
Definition at line 86 of file RegisterContextUnwind.cpp.
References lldb_private::Address::GetOffset(), m_current_offset, m_current_pc, and lldb_private::Address::SetOffset().
Referenced by GetFullUnwindPlanForFrame(), and InitializeNonZerothFrame().
bool RegisterContextUnwind::IsValid | ( | ) | const |
Definition at line 1205 of file RegisterContextUnwind.cpp.
References eNotAValidFrame, and m_frame_type.
Referenced by GetCFA(), GetStartPC(), InitializeNonZerothFrame(), ReadGPRValue(), ReadPC(), ReadRegister(), ReadRegisterValueFromRegisterLocation(), WriteRegister(), and WriteRegisterValueToRegisterLocation().
|
privatedelete |
|
private |
Check if the given unwind plan indicates a signal trap handler, and update frame type and symbol context if so.
Definition at line 1922 of file RegisterContextUnwind.cpp.
References lldb_private::eLazyBoolYes, eNormalFrame, eTrapHandlerFrame, lldb_private::AddressRange::GetBaseAddress(), lldb_private::Address::GetLoadAddress(), 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, lldb_private::Address::ResolveFunctionScope(), and UnwindLogMsg().
Referenced by ForceSwitchToFallbackUnwindPlan(), InitializeNonZerothFrame(), and TryFallbackUnwindPlan().
|
overridevirtual |
Reimplemented from lldb_private::RegisterContext.
Definition at line 2293 of file RegisterContextUnwind.cpp.
|
private |
Definition at line 1969 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::Thread::GetProcess(), 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(), SavedLocationForRegister(), and TryFallbackUnwindPlan().
|
private |
Definition at line 2218 of file RegisterContextUnwind.cpp.
References RegisterNumber::GetRegisterKind(), RegisterNumber::GetRegisterNumber(), and ReadGPRValue().
|
private |
Definition at line 2146 of file RegisterContextUnwind.cpp.
References lldb::eRegisterKindGeneric, lldb::eRegisterKindLLDB, lldb_private::RegisterValue::GetAsUInt64(), lldb_private::Thread::GetProcess(), lldb_private::Thread::GetRegisterContext(), 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(), lldb_private::UnwindLLDB::SearchForSavedLocationForRegister(), and UnwindLogMsg().
Referenced by GetReturnAddressHint(), InitializeNonZerothFrame(), ReadFrameAddress(), ReadGPRValue(), and ReadPC().
bool RegisterContextUnwind::ReadPC | ( | lldb::addr_t & | start_pc | ) |
Definition at line 2354 of file RegisterContextUnwind.cpp.
References lldb::eRegisterKindGeneric, GetNextFrame(), lldb_private::Thread::GetProcess(), 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 2226 of file RegisterContextUnwind.cpp.
References lldb::eRegisterKindGeneric, lldb::eRegisterKindLLDB, lldb_private::RegisterValue::eTypeUInt64, lldb_private::RegisterValue::GetAsUInt64(), lldb_private::Thread::GetProcess(), lldb_private::Thread::GetRegisterContext(), 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(), lldb_private::UnwindLLDB::SearchForSavedLocationForRegister(), and UnwindLogMsgVerbose().
|
private |
Definition at line 1110 of file RegisterContextUnwind.cpp.
References lldb_private::RegisterInfo::byte_size, lldb_private::UnwindLLDB::ConcreteRegisterLocation::eRegisterInLiveRegisterContext, lldb_private::UnwindLLDB::ConcreteRegisterLocation::eRegisterInRegister, lldb_private::UnwindLLDB::ConcreteRegisterLocation::eRegisterNotSaved, lldb_private::UnwindLLDB::ConcreteRegisterLocation::eRegisterSavedAtHostMemoryLocation, lldb_private::UnwindLLDB::ConcreteRegisterLocation::eRegisterSavedAtMemoryLocation, lldb_private::UnwindLLDB::ConcreteRegisterLocation::eRegisterValueInferred, error(), GetNextFrame(), lldb_private::Thread::GetRegisterContext(), GetRegisterInfoAtIndex(), lldb_private::UnwindLLDB::ConcreteRegisterLocation::inferred_value, IsFrameZero(), IsValid(), lldb_private::UnwindLLDB::ConcreteRegisterLocation::location, m_thread, lldb_private::RegisterContext::ReadRegisterValueFromMemory(), lldb_private::UnwindLLDB::ConcreteRegisterLocation::register_number, lldb_private::RegisterValue::SetUInt(), lldb_private::UnwindLLDB::ConcreteRegisterLocation::target_memory_location, and lldb_private::UnwindLLDB::ConcreteRegisterLocation::type.
Referenced by ReadGPRValue(), ReadRegister(), and TryFallbackUnwindPlan().
|
private |
Definition at line 1261 of file RegisterContextUnwind.cpp.
References lldb_private::eLazyBoolYes, 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, eTrapHandlerFrame, lldb_private::DWARFExpressionList::Evaluate(), ForceSwitchToFallbackUnwindPlan(), lldb_private::Process::GetABI(), lldb_private::Process::GetAddressByteSize(), RegisterNumber::GetAsKind(), lldb_private::Process::GetByteOrder(), lldb_private::UnwindPlan::Row::AbstractRegisterLocation::GetConstant(), lldb_private::StreamString::GetData(), lldb_private::UnwindPlan::Row::AbstractRegisterLocation::GetDWARFExpressionBytes(), lldb_private::UnwindPlan::Row::AbstractRegisterLocation::GetDWARFExpressionLength(), lldb_private::ABI::GetFallbackRegisterLocation(), GetFullUnwindPlanForFrame(), lldb_private::Address::GetLoadAddress(), lldb_private::GetLog(), lldb_private::DWARFExpressionList::GetMutableExpressionAtAddress(), RegisterNumber::GetName(), lldb_private::UnwindPlan::Row::AbstractRegisterLocation::GetOffset(), lldb_private::ExecutionContext::GetProcessPtr(), GetRegisterInfoAtIndex(), lldb_private::UnwindPlan::Row::AbstractRegisterLocation::GetRegisterNumber(), lldb_private::ExecutionContext::GetTargetPtr(), lldb_private::UnwindLLDB::ConcreteRegisterLocation::inferred_value, RegisterNumber::init(), lldb_private::UnwindPlan::Row::AbstractRegisterLocation::IsAFAPlusOffset(), lldb_private::UnwindPlan::Row::AbstractRegisterLocation::IsAtAFAPlusOffset(), lldb_private::UnwindPlan::Row::AbstractRegisterLocation::IsAtCFAPlusOffset(), lldb_private::UnwindPlan::Row::AbstractRegisterLocation::IsAtDWARFExpression(), lldb_private::UnwindPlan::Row::AbstractRegisterLocation::IsCFAPlusOffset(), lldb_private::UnwindPlan::Row::AbstractRegisterLocation::IsConstant(), lldb_private::UnwindPlan::Row::AbstractRegisterLocation::IsDWARFExpression(), IsFrameZero(), lldb_private::UnwindPlan::Row::AbstractRegisterLocation::IsInOtherRegister(), lldb_private::UnwindPlan::Row::AbstractRegisterLocation::IsSame(), lldb_private::UnwindPlan::Row::AbstractRegisterLocation::IsUndefined(), lldb_private::UnwindPlan::Row::AbstractRegisterLocation::IsUnspecified(), RegisterNumber::IsValid(), lldb::kNumRegisterKinds, 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_all_registers_available, m_cfa, m_current_offset, m_current_offset_backed_up_one, m_fast_unwind_plan_sp, m_frame_type, m_full_unwind_plan_sp, m_registers, m_start_pc, m_thread, ReadFrameAddress(), 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 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.
Definition at line 1736 of file RegisterContextUnwind.cpp.
References lldb_private::eLazyBoolYes, lldb_private::UnwindLLDB::eRegisterFound, lldb::eRegisterKindGeneric, lldb::eRegisterKindLLDB, RegisterNumber::GetAsKind(), lldb_private::RegisterValue::GetAsUInt64(), lldb_private::Thread::GetProcess(), GetRegisterInfoAtIndex(), 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 2381 of file RegisterContextUnwind.cpp.
References lldb_private::Thread::GetIndexID(), lldb_private::GetLog(), LLDB_LOGF, m_frame_number, m_thread, lldb_private::Unwind, and lldb_private::VASprintf().
Referenced by ForceSwitchToFallbackUnwindPlan(), GetFullUnwindPlanForFrame(), InitializeNonZerothFrame(), InitializeZerothFrame(), PropagateTrapHandlerFlagFromUnwindPlan(), ReadFrameAddress(), ReadGPRValue(), SavedLocationForRegister(), and TryFallbackUnwindPlan().
|
private |
Definition at line 2398 of file RegisterContextUnwind.cpp.
References lldb_private::Thread::GetIndexID(), lldb_private::GetLog(), lldb_private::Log::GetVerbose(), LLDB_LOGF, m_frame_number, m_thread, lldb_private::Unwind, and lldb_private::VASprintf().
Referenced by GetFullUnwindPlanForFrame(), GetReturnAddressHint(), ReadRegister(), and WriteRegister().
|
overridevirtual |
Reimplemented from lldb_private::RegisterContext.
Definition at line 2299 of file RegisterContextUnwind.cpp.
|
overridevirtual |
Implements lldb_private::RegisterContext.
Definition at line 2267 of file RegisterContextUnwind.cpp.
References lldb::eRegisterKindLLDB, lldb_private::Thread::GetRegisterContext(), IsFrameZero(), IsValid(), lldb_private::RegisterInfo::kinds, m_frame_number, m_parent_unwind, m_thread, lldb_private::UnwindLLDB::SearchForSavedLocationForRegister(), UnwindLogMsgVerbose(), and WriteRegisterValueToRegisterLocation().
|
private |
Definition at line 1163 of file RegisterContextUnwind.cpp.
References lldb_private::RegisterInfo::byte_size, lldb_private::UnwindLLDB::ConcreteRegisterLocation::eRegisterInLiveRegisterContext, lldb_private::UnwindLLDB::ConcreteRegisterLocation::eRegisterInRegister, lldb_private::UnwindLLDB::ConcreteRegisterLocation::eRegisterNotSaved, lldb_private::UnwindLLDB::ConcreteRegisterLocation::eRegisterSavedAtHostMemoryLocation, lldb_private::UnwindLLDB::ConcreteRegisterLocation::eRegisterSavedAtMemoryLocation, lldb_private::UnwindLLDB::ConcreteRegisterLocation::eRegisterValueInferred, error(), GetNextFrame(), lldb_private::Thread::GetRegisterContext(), 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 88 of file RegisterContextUnwind.h.
|
private |
Definition at line 226 of file RegisterContextUnwind.h.
Referenced by ForceSwitchToFallbackUnwindPlan(), InitializeNonZerothFrame(), InitializeZerothFrame(), SavedLocationForRegister(), and TryFallbackUnwindPlan().
|
private |
Definition at line 221 of file RegisterContextUnwind.h.
Referenced by GetFullUnwindPlanForFrame(), InitializeNonZerothFrame(), ReadPC(), RegisterContextUnwind(), and SavedLocationForRegister().
|
private |
Definition at line 243 of file RegisterContextUnwind.h.
Referenced by BehavesLikeZerothFrame(), GetFullUnwindPlanForFrame(), InitializeNonZerothFrame(), and InitializeZerothFrame().
|
private |
Definition at line 225 of file RegisterContextUnwind.h.
Referenced by CheckIfLoopingStack(), ForceSwitchToFallbackUnwindPlan(), GetCFA(), InitializeNonZerothFrame(), InitializeZerothFrame(), SavedLocationForRegister(), and TryFallbackUnwindPlan().
|
private |
Definition at line 230 of file RegisterContextUnwind.h.
Referenced by ForceSwitchToFallbackUnwindPlan(), GetFullUnwindPlanForFrame(), InitializeNonZerothFrame(), InitializeZerothFrame(), IsUnwindPlanValidForCurrentPC(), PropagateTrapHandlerFlagFromUnwindPlan(), and SavedLocationForRegister().
|
private |
Definition at line 240 of file RegisterContextUnwind.h.
Referenced by InitializeNonZerothFrame(), InitializeZerothFrame(), PropagateTrapHandlerFlagFromUnwindPlan(), SavedLocationForRegister(), and TryFallbackUnwindPlan().
|
private |
Definition at line 228 of file RegisterContextUnwind.h.
Referenced by GetFastUnwindPlanForFrame(), GetFullUnwindPlanForFrame(), InitializeNonZerothFrame(), InitializeZerothFrame(), IsUnwindPlanValidForCurrentPC(), and PropagateTrapHandlerFlagFromUnwindPlan().
|
private |
Definition at line 219 of file RegisterContextUnwind.h.
Referenced by ForceSwitchToFallbackUnwindPlan(), GetFullUnwindPlanForFrame(), InitializeZerothFrame(), and TryFallbackUnwindPlan().
|
private |
Definition at line 217 of file RegisterContextUnwind.h.
Referenced by GetFullUnwindPlanForFrame(), InitializeNonZerothFrame(), InitializeZerothFrame(), and SavedLocationForRegister().
|
private |
Definition at line 249 of file RegisterContextUnwind.h.
Referenced by BehavesLikeZerothFrame(), GetNextFrame(), GetPrevFrame(), IsFrameZero(), ReadGPRValue(), ReadRegister(), UnwindLogMsg(), UnwindLogMsgVerbose(), and WriteRegister().
|
private |
Definition at line 223 of file RegisterContextUnwind.h.
Referenced by GetFastUnwindPlanForFrame(), GetFullUnwindPlanForFrame(), InitializeNonZerothFrame(), InitializeZerothFrame(), InvalidateAllRegisters(), IsSkipFrame(), IsTrapHandlerFrame(), IsValid(), PropagateTrapHandlerFlagFromUnwindPlan(), and SavedLocationForRegister().
|
private |
Definition at line 218 of file RegisterContextUnwind.h.
Referenced by ForceSwitchToFallbackUnwindPlan(), InitializeNonZerothFrame(), InitializeZerothFrame(), SavedLocationForRegister(), and TryFallbackUnwindPlan().
|
private |
Definition at line 254 of file RegisterContextUnwind.h.
Referenced by GetNextFrame(), GetPrevFrame(), IsTrapHandlerSymbol(), ReadGPRValue(), ReadRegister(), and WriteRegister().
|
private |
Definition at line 252 of file RegisterContextUnwind.h.
Referenced by ForceSwitchToFallbackUnwindPlan(), SavedLocationForRegister(), and TryFallbackUnwindPlan().
|
private |
Definition at line 227 of file RegisterContextUnwind.h.
Referenced by GetStartPC(), InitializeNonZerothFrame(), InitializeZerothFrame(), PropagateTrapHandlerFlagFromUnwindPlan(), and SavedLocationForRegister().
|
private |
Definition at line 245 of file RegisterContextUnwind.h.
Referenced by GetFastUnwindPlanForFrame(), GetFullUnwindPlanForFrame(), GetReturnAddressHint(), InitializeNonZerothFrame(), InitializeZerothFrame(), IsTrapHandlerSymbol(), PropagateTrapHandlerFlagFromUnwindPlan(), and RegisterContextUnwind().
|
private |
Definition at line 246 of file RegisterContextUnwind.h.
Referenced by GetFullUnwindPlanForFrame(), InitializeNonZerothFrame(), InitializeZerothFrame(), PropagateTrapHandlerFlagFromUnwindPlan(), and RegisterContextUnwind().
|
private |
Definition at line 209 of file RegisterContextUnwind.h.
Referenced by ConvertRegisterKindToRegisterNumber(), GetFastUnwindPlanForFrame(), GetFullUnwindPlanForFrame(), GetRegisterCount(), GetRegisterInfoAtIndex(), GetRegisterSet(), GetRegisterSetCount(), GetReturnAddressHint(), GetStartPC(), InitializeNonZerothFrame(), InitializeZerothFrame(), PropagateTrapHandlerFlagFromUnwindPlan(), ReadFrameAddress(), ReadGPRValue(), ReadPC(), ReadRegister(), ReadRegisterValueFromRegisterLocation(), SavedLocationForRegister(), TryFallbackUnwindPlan(), UnwindLogMsg(), UnwindLogMsgVerbose(), WriteRegister(), and WriteRegisterValueToRegisterLocation().