LLDB mainline
|
#include <DWARFCallFrameInfo.h>
Classes | |
struct | CIE |
Public Types | |
enum | Type { EH , DWARF } |
typedef RangeVector< lldb::addr_t, uint32_t > | FunctionAddressAndSizeVector |
Public Member Functions | |
DWARFCallFrameInfo (ObjectFile &objfile, lldb::SectionSP §ion, Type type) | |
~DWARFCallFrameInfo ()=default | |
bool | GetAddressRange (Address addr, AddressRange &range) |
bool | GetUnwindPlan (const Address &addr, UnwindPlan &unwind_plan) |
Return an UnwindPlan based on the call frame information encoded in the FDE of this DWARFCallFrameInfo section. | |
bool | GetUnwindPlan (const AddressRange &range, UnwindPlan &unwind_plan) |
Return an UnwindPlan based on the call frame information encoded in the FDE of this DWARFCallFrameInfo section. | |
void | GetFunctionAddressAndSizeVector (FunctionAddressAndSizeVector &function_info) |
void | ForEachFDEEntries (const std::function< bool(lldb::addr_t, uint32_t, dw_offset_t)> &callback) |
Private Types | |
enum | { CFI_AUG_MAX_SIZE = 8 , CFI_HEADER_SIZE = 8 } |
enum | CFIVersion { CFI_VERSION1 = 1 , CFI_VERSION3 = 3 , CFI_VERSION4 = 4 } |
typedef std::shared_ptr< CIE > | CIESP |
typedef std::map< dw_offset_t, CIESP > | cie_map_t |
typedef RangeDataVector< lldb::addr_t, uint32_t, dw_offset_t > | FDEEntryMap |
Private Member Functions | |
bool | IsEHFrame () const |
std::optional< FDEEntryMap::Entry > | GetFirstFDEEntryInRange (const AddressRange &range) |
void | GetFDEIndex () |
bool | FDEToUnwindPlan (dw_offset_t offset, Address startaddr, UnwindPlan &unwind_plan) |
const CIE * | GetCIE (dw_offset_t cie_offset) |
void | GetCFIData () |
bool | HandleCommonDwarfOpcode (uint8_t primary_opcode, uint8_t extended_opcode, int32_t data_align, lldb::offset_t &offset, UnwindPlan::Row &row) |
CIESP | ParseCIE (const dw_offset_t cie_offset) |
lldb::RegisterKind | GetRegisterKind () const |
Private Attributes | |
ObjectFile & | m_objfile |
lldb::SectionSP | m_section_sp |
Flags | m_flags = 0 |
cie_map_t | m_cie_map |
DataExtractor | m_cfi_data |
bool | m_cfi_data_initialized = false |
FDEEntryMap | m_fde_index |
bool | m_fde_index_initialized = false |
std::mutex | m_fde_index_mutex |
Type | m_type |
Definition at line 34 of file DWARFCallFrameInfo.h.
|
private |
Definition at line 117 of file DWARFCallFrameInfo.h.
|
private |
Definition at line 115 of file DWARFCallFrameInfo.h.
|
private |
Definition at line 122 of file DWARFCallFrameInfo.h.
typedef RangeVector<lldb::addr_t, uint32_t> lldb_private::DWARFCallFrameInfo::FunctionAddressAndSizeVector |
Definition at line 57 of file DWARFCallFrameInfo.h.
|
private |
Enumerator | |
---|---|
CFI_AUG_MAX_SIZE | |
CFI_HEADER_SIZE |
Definition at line 80 of file DWARFCallFrameInfo.h.
|
private |
Enumerator | |
---|---|
CFI_VERSION1 | |
CFI_VERSION3 | |
CFI_VERSION4 |
Definition at line 81 of file DWARFCallFrameInfo.h.
Enumerator | |
---|---|
EH | |
DWARF |
Definition at line 36 of file DWARFCallFrameInfo.h.
DWARFCallFrameInfo::DWARFCallFrameInfo | ( | ObjectFile & | objfile, |
lldb::SectionSP & | section, | ||
Type | type | ||
) |
Definition at line 150 of file DWARFCallFrameInfo.cpp.
|
default |
|
private |
Definition at line 525 of file DWARFCallFrameInfo.cpp.
References lldb_private::UnwindPlan::AppendRow(), lldb_private::DWARFCallFrameInfo::CIE::augmentation, lldb_private::DWARFCallFrameInfo::CIE::code_align, lldb_private::DWARFCallFrameInfo::CIE::data_align, DW_EH_PE_MASK_ENCODING, EH, lldb_private::eLazyBoolNo, lldb_private::eLazyBoolYes, lldb_private::DataExtractor::GetAddress(), lldb_private::ObjectFile::GetAddressByteSize(), GetCFIData(), GetCIE(), lldb_private::Address::GetFileAddress(), GetGNUEHPointer(), lldb_private::GetLog(), lldb_private::ModuleChild::GetModule(), GetRegisterKind(), lldb_private::UnwindPlan::GetRowAtIndex(), lldb_private::ObjectFile::GetSectionList(), lldb_private::DataExtractor::GetU16(), lldb_private::DataExtractor::GetU32(), lldb_private::DataExtractor::GetU64(), lldb_private::DataExtractor::GetU8(), lldb_private::DataExtractor::GetULEB128(), HandleCommonDwarfOpcode(), lldb_private::DWARFCallFrameInfo::CIE::initial_row, lldb_private::Address::IsValid(), lldb_private::UnwindPlan::IsValidRowIndex(), LLDB_INVALID_ADDRESS, LLDB_LOG, lldb_private::DWARFCallFrameInfo::CIE::lsda_addr_encoding, m_cfi_data, m_cfi_data_initialized, m_objfile, m_section_sp, m_type, lldb_private::DWARFCallFrameInfo::CIE::personality_loc, lldb_private::DWARFCallFrameInfo::CIE::ptr_encoding, lldb_private::DWARFCallFrameInfo::CIE::return_addr_reg_num, lldb_private::AddressRange::SetByteSize(), lldb_private::UnwindPlan::SetLSDAAddress(), lldb_private::UnwindPlan::Row::SetOffset(), lldb_private::UnwindPlan::SetPersonalityFunctionPtr(), lldb_private::UnwindPlan::SetPlanValidAddressRange(), lldb_private::UnwindPlan::SetRegisterKind(), lldb_private::UnwindPlan::SetReturnAddressRegister(), lldb_private::UnwindPlan::SetSourcedFromCompiler(), lldb_private::UnwindPlan::SetSourceName(), lldb_private::UnwindPlan::SetUnwindPlanForSignalTrap(), lldb_private::UnwindPlan::SetUnwindPlanValidAtAllInstructions(), lldb_private::UnwindPlan::Row::SlideOffset(), UINT32_MAX, lldb_private::Unwind, and lldb_private::DataExtractor::ValidOffset().
Referenced by GetUnwindPlan().
void DWARFCallFrameInfo::ForEachFDEEntries | ( | const std::function< bool(lldb::addr_t, uint32_t, dw_offset_t)> & | callback | ) |
Definition at line 1018 of file DWARFCallFrameInfo.cpp.
References lldb_private::Range< B, S >::base, lldb_private::RangeData< B, S, T >::data, lldb_private::RangeDataVector< B, S, T, N, Compare >::GetEntryRef(), GetFDEIndex(), lldb_private::RangeDataVector< B, S, T, N, Compare >::GetSize(), m_fde_index, and lldb_private::Range< B, S >::size.
Referenced by ObjectFileELF::ParseUnwindSymbols().
bool DWARFCallFrameInfo::GetAddressRange | ( | Address | addr, |
AddressRange & | range | ||
) |
Definition at line 176 of file DWARFCallFrameInfo.cpp.
References lldb_private::Range< B, S >::base, lldb_private::RangeDataVector< B, S, T, N, Compare >::FindEntryThatContains(), GetFDEIndex(), lldb_private::Address::GetFileAddress(), lldb_private::Address::GetModule(), lldb_private::ObjectFile::GetSectionList(), m_fde_index, m_objfile, m_section_sp, and lldb_private::Range< B, S >::size.
|
private |
Definition at line 401 of file DWARFCallFrameInfo.cpp.
References lldb_private::GetLog(), lldb_private::ModuleChild::GetModule(), m_cfi_data, m_cfi_data_initialized, m_objfile, m_section_sp, lldb_private::ObjectFile::ReadSectionData(), and lldb_private::Unwind.
Referenced by FDEToUnwindPlan(), GetFDEIndex(), and ParseCIE().
|
private |
Definition at line 234 of file DWARFCallFrameInfo.cpp.
References m_cie_map, and ParseCIE().
Referenced by FDEToUnwindPlan(), and GetFDEIndex().
|
private |
Definition at line 414 of file DWARFCallFrameInfo.cpp.
References lldb_private::RangeDataVector< B, S, T, N, Compare >::Append(), lldb_private::ConstString::AsCString(), lldb_private::RangeDataVector< B, S, T, N, Compare >::Clear(), DW_EH_PE_MASK_ENCODING, DWARF, EH, lldb_private::ObjectFile::GetArchitecture(), lldb_private::DataExtractor::GetByteSize(), GetCFIData(), GetCIE(), lldb_private::FileSpec::GetFilename(), lldb_private::ObjectFile::GetFileSpec(), GetGNUEHPointer(), lldb_private::DataExtractor::GetU32(), lldb_private::DataExtractor::GetU64(), LLDB_INVALID_ADDRESS, LLDB_SCOPED_TIMERF, m_cfi_data, m_cfi_data_initialized, m_cie_map, m_fde_index, m_fde_index_initialized, m_fde_index_mutex, m_objfile, m_section_sp, m_type, ParseCIE(), lldb_private::DWARFCallFrameInfo::CIE::ptr_encoding, lldb_private::Debugger::ReportError(), lldb_private::RangeDataVector< B, S, T, N, Compare >::Sort(), UINT32_MAX, and lldb_private::DataExtractor::ValidOffsetForDataOfSize().
Referenced by ForEachFDEEntries(), GetAddressRange(), GetFirstFDEEntryInRange(), and GetFunctionAddressAndSizeVector().
|
private |
Definition at line 199 of file DWARFCallFrameInfo.cpp.
References lldb_private::Range< B, S >::DoesIntersect(), lldb_private::RangeDataVector< B, S, T, N, Compare >::FindEntryThatContainsOrFollows(), lldb_private::AddressRange::GetBaseAddress(), lldb_private::AddressRange::GetByteSize(), GetFDEIndex(), lldb_private::Address::GetFileAddress(), m_fde_index, and m_section_sp.
Referenced by GetUnwindPlan().
void DWARFCallFrameInfo::GetFunctionAddressAndSizeVector | ( | FunctionAddressAndSizeVector & | function_info | ) |
Definition at line 215 of file DWARFCallFrameInfo.cpp.
References lldb_private::RangeVector< B, S, N >::Append(), lldb_private::Range< B, S >::base, lldb_private::RangeVector< B, S, N >::Clear(), lldb_private::RangeDataVector< B, S, T, N, Compare >::GetEntryAtIndex(), GetFDEIndex(), lldb_private::RangeDataVector< B, S, T, N, Compare >::GetSize(), m_fde_index, lldb_private::RangeVector< B, S, N >::Reserve(), and lldb_private::Range< B, S >::size.
Referenced by ObjectFileMachO::ParseSymtab().
|
inlineprivate |
Definition at line 164 of file DWARFCallFrameInfo.h.
References EH, lldb::eRegisterKindDWARF, lldb::eRegisterKindEHFrame, and m_type.
Referenced by FDEToUnwindPlan().
bool DWARFCallFrameInfo::GetUnwindPlan | ( | const Address & | addr, |
UnwindPlan & | unwind_plan | ||
) |
Return an UnwindPlan based on the call frame information encoded in the FDE of this DWARFCallFrameInfo section.
The returned plan will be valid (at least) for the given address.
Definition at line 154 of file DWARFCallFrameInfo.cpp.
References GetUnwindPlan().
Referenced by lldb_private::FuncUnwinders::GetDebugFrameUnwindPlan(), lldb_private::FuncUnwinders::GetEHFrameUnwindPlan(), lldb_private::RegisterContextUnwind::GetFullUnwindPlanForFrame(), and GetUnwindPlan().
bool DWARFCallFrameInfo::GetUnwindPlan | ( | const AddressRange & | range, |
UnwindPlan & | unwind_plan | ||
) |
Return an UnwindPlan based on the call frame information encoded in the FDE of this DWARFCallFrameInfo section.
The returned plan will be valid (at least) for some address in the given range.
Definition at line 159 of file DWARFCallFrameInfo.cpp.
References FDEToUnwindPlan(), lldb_private::AddressRange::GetBaseAddress(), GetFirstFDEEntryInRange(), lldb_private::Address::GetModule(), and m_objfile.
|
private |
Definition at line 820 of file DWARFCallFrameInfo.cpp.
References lldb_private::UnwindPlan::Row::GetCFAValue(), lldb_private::DataExtractor::GetData(), lldb_private::UnwindPlan::Row::FAValue::GetOffset(), lldb_private::UnwindPlan::Row::FAValue::GetRegisterNumber(), lldb_private::DataExtractor::GetSLEB128(), lldb_private::DataExtractor::GetULEB128(), m_cfi_data, lldb_private::UnwindPlan::Row::RegisterLocation::SetAtCFAPlusOffset(), lldb_private::UnwindPlan::Row::RegisterLocation::SetAtDWARFExpression(), lldb_private::UnwindPlan::Row::RegisterLocation::SetInRegister(), lldb_private::UnwindPlan::Row::RegisterLocation::SetIsDWARFExpression(), lldb_private::UnwindPlan::Row::FAValue::SetIsDWARFExpression(), lldb_private::UnwindPlan::Row::FAValue::SetIsRegisterPlusOffset(), lldb_private::UnwindPlan::Row::SetRegisterInfo(), lldb_private::UnwindPlan::Row::RegisterLocation::SetSame(), and lldb_private::UnwindPlan::Row::RegisterLocation::SetUndefined().
Referenced by FDEToUnwindPlan(), and ParseCIE().
|
private |
|
private |
Definition at line 248 of file DWARFCallFrameInfo.cpp.
References CFI_AUG_MAX_SIZE, CFI_VERSION3, CFI_VERSION4, DWARF, EH, GetCFIData(), GetGNUEHPointer(), lldb_private::DataExtractor::GetSLEB128(), lldb_private::DataExtractor::GetU32(), lldb_private::DataExtractor::GetU64(), lldb_private::DataExtractor::GetU8(), lldb_private::DataExtractor::GetULEB128(), HandleCommonDwarfOpcode(), LLDB_INVALID_ADDRESS, m_cfi_data, m_cfi_data_initialized, m_section_sp, m_type, lldb_private::Debugger::ReportError(), and UINT32_MAX.
Referenced by GetCIE(), and GetFDEIndex().
|
private |
Definition at line 152 of file DWARFCallFrameInfo.h.
Referenced by FDEToUnwindPlan(), GetCFIData(), GetFDEIndex(), HandleCommonDwarfOpcode(), and ParseCIE().
|
private |
Definition at line 153 of file DWARFCallFrameInfo.h.
Referenced by FDEToUnwindPlan(), GetCFIData(), GetFDEIndex(), and ParseCIE().
|
private |
Definition at line 150 of file DWARFCallFrameInfo.h.
Referenced by GetCIE(), and GetFDEIndex().
|
private |
Definition at line 155 of file DWARFCallFrameInfo.h.
Referenced by ForEachFDEEntries(), GetAddressRange(), GetFDEIndex(), GetFirstFDEEntryInRange(), and GetFunctionAddressAndSizeVector().
|
private |
Definition at line 156 of file DWARFCallFrameInfo.h.
Referenced by GetFDEIndex().
|
private |
Definition at line 157 of file DWARFCallFrameInfo.h.
Referenced by GetFDEIndex().
|
private |
Definition at line 149 of file DWARFCallFrameInfo.h.
|
private |
Definition at line 147 of file DWARFCallFrameInfo.h.
Referenced by FDEToUnwindPlan(), GetAddressRange(), GetCFIData(), GetFDEIndex(), and GetUnwindPlan().
|
private |
Definition at line 148 of file DWARFCallFrameInfo.h.
Referenced by FDEToUnwindPlan(), GetAddressRange(), GetCFIData(), GetFDEIndex(), GetFirstFDEEntryInRange(), and ParseCIE().
|
private |
Definition at line 159 of file DWARFCallFrameInfo.h.
Referenced by FDEToUnwindPlan(), GetFDEIndex(), GetRegisterKind(), and ParseCIE().