|
LLDB mainline
|
#include <DWARFCallFrameInfo.h>
Classes | |
| struct | CIE |
| struct | FDE |
| Parsed representation of a Frame Descriptor Entry. More... | |
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) |
| std::unique_ptr< UnwindPlan > | GetUnwindPlan (const Address &addr) |
| Return an UnwindPlan based on the call frame information encoded in the FDE of this DWARFCallFrameInfo section. | |
| std::unique_ptr< UnwindPlan > | GetUnwindPlan (const Address &pc, const Address &func_start) |
| Return an UnwindPlan based on the call frame information encoded in the FDE of this DWARFCallFrameInfo section. | |
| std::unique_ptr< UnwindPlan > | GetUnwindPlan (llvm::ArrayRef< AddressRange > ranges, const Address &addr) |
| 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 () |
| std::optional< FDE > | ParseFDE (dw_offset_t offset, const Address &startaddr) |
| 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 33 of file DWARFCallFrameInfo.h.
|
private |
Definition at line 126 of file DWARFCallFrameInfo.h.
|
private |
Definition at line 124 of file DWARFCallFrameInfo.h.
|
private |
Definition at line 131 of file DWARFCallFrameInfo.h.
| typedef RangeVector<lldb::addr_t, uint32_t> lldb_private::DWARFCallFrameInfo::FunctionAddressAndSizeVector |
Definition at line 66 of file DWARFCallFrameInfo.h.
|
private |
| Enumerator | |
|---|---|
| CFI_AUG_MAX_SIZE | |
| CFI_HEADER_SIZE | |
Definition at line 89 of file DWARFCallFrameInfo.h.
|
private |
| Enumerator | |
|---|---|
| CFI_VERSION1 | |
| CFI_VERSION3 | |
| CFI_VERSION4 | |
Definition at line 90 of file DWARFCallFrameInfo.h.
| Enumerator | |
|---|---|
| EH | |
| DWARF | |
Definition at line 35 of file DWARFCallFrameInfo.h.
| DWARFCallFrameInfo::DWARFCallFrameInfo | ( | ObjectFile & | objfile, |
| lldb::SectionSP & | section, | ||
| Type | type ) |
Definition at line 169 of file DWARFCallFrameInfo.cpp.
References m_objfile, m_section_sp, and m_type.
|
default |
References pc.
| void DWARFCallFrameInfo::ForEachFDEEntries | ( | const std::function< bool(lldb::addr_t, uint32_t, dw_offset_t)> & | callback | ) |
Definition at line 1028 of file DWARFCallFrameInfo.cpp.
References lldb_private::Range< B, S >::base, lldb_private::RangeData< B, S, T >::data, GetFDEIndex(), m_fde_index, and lldb_private::Range< B, S >::size.
Referenced by ObjectFileELF::ParseUnwindSymbols().
| bool DWARFCallFrameInfo::GetAddressRange | ( | Address | addr, |
| AddressRange & | range ) |
Definition at line 232 of file DWARFCallFrameInfo.cpp.
References lldb_private::Range< B, S >::base, GetFDEIndex(), lldb_private::Address::GetFileAddress(), lldb_private::Address::GetModule(), m_fde_index, m_objfile, m_section_sp, and lldb_private::Range< B, S >::size.
|
private |
Definition at line 458 of file DWARFCallFrameInfo.cpp.
References lldb_private::GetLog(), m_cfi_data, m_cfi_data_initialized, m_objfile, m_section_sp, and lldb_private::Unwind.
Referenced by GetFDEIndex(), ParseCIE(), and ParseFDE().
|
private |
Definition at line 290 of file DWARFCallFrameInfo.cpp.
References m_cie_map, and ParseCIE().
Referenced by GetFDEIndex(), and ParseFDE().
|
private |
Definition at line 471 of file DWARFCallFrameInfo.cpp.
References DW_EH_PE_MASK_ENCODING, DWARF, GetCFIData(), GetCIE(), GetGNUEHPointer(), IsCIEMarker(), 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, and lldb_private::Debugger::ReportError().
Referenced by ForEachFDEEntries(), GetAddressRange(), GetFirstFDEEntryInRange(), and GetFunctionAddressAndSizeVector().
|
private |
Definition at line 255 of file DWARFCallFrameInfo.cpp.
References lldb_private::Range< B, S >::DoesIntersect(), 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 271 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(), GetFDEIndex(), 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 179 of file DWARFCallFrameInfo.h.
References EH, lldb::eRegisterKindDWARF, lldb::eRegisterKindEHFrame, and m_type.
Referenced by GetUnwindPlan().
| std::unique_ptr< UnwindPlan > DWARFCallFrameInfo::GetUnwindPlan | ( | const Address & | addr | ) |
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 174 of file DWARFCallFrameInfo.cpp.
References GetUnwindPlan().
Referenced by GetUnwindPlan(), and GetUnwindPlan().
| std::unique_ptr< UnwindPlan > DWARFCallFrameInfo::GetUnwindPlan | ( | const Address & | pc, |
| const Address & | func_start ) |
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 pc. func_start corresponds to the offset zero in the returned UnwindPlan.
Definition at line 179 of file DWARFCallFrameInfo.cpp.
References GetUnwindPlan(), and pc.
| std::unique_ptr< UnwindPlan > DWARFCallFrameInfo::GetUnwindPlan | ( | llvm::ArrayRef< AddressRange > | ranges, |
| const Address & | addr ) |
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 ranges. If no unwind information is found, nullptr is returned. addr represents the entry point of the function. It corresponds to the offset zero in the returned UnwindPlan.
Definition at line 185 of file DWARFCallFrameInfo.cpp.
References EH, lldb_private::eLazyBoolNo, lldb_private::eLazyBoolYes, lldb_private::Address::GetFileAddress(), GetFirstFDEEntryInRange(), lldb_private::Address::GetModule(), GetRegisterKind(), m_objfile, m_type, ParseFDE(), and lldb_private::UnwindPlan::Row::SlideOffset().
|
private |
Definition at line 830 of file DWARFCallFrameInfo.cpp.
References lldb_private::UnwindPlan::Row::GetCFAValue(), lldb_private::UnwindPlan::Row::FAValue::GetOffset(), lldb_private::UnwindPlan::Row::FAValue::GetRegisterNumber(), m_cfi_data, lldb_private::UnwindPlan::Row::AbstractRegisterLocation::SetAtCFAPlusOffset(), lldb_private::UnwindPlan::Row::AbstractRegisterLocation::SetAtDWARFExpression(), lldb_private::UnwindPlan::Row::AbstractRegisterLocation::SetInRegister(), lldb_private::UnwindPlan::Row::AbstractRegisterLocation::SetIsDWARFExpression(), lldb_private::UnwindPlan::Row::FAValue::SetIsDWARFExpression(), lldb_private::UnwindPlan::Row::FAValue::SetIsRegisterPlusOffset(), lldb_private::UnwindPlan::Row::SetRegisterInfo(), lldb_private::UnwindPlan::Row::AbstractRegisterLocation::SetSame(), and lldb_private::UnwindPlan::Row::AbstractRegisterLocation::SetUndefined().
Referenced by ParseCIE(), and ParseFDE().
|
private |
|
private |
Definition at line 304 of file DWARFCallFrameInfo.cpp.
References CFI_AUG_MAX_SIZE, CFI_VERSION3, CFI_VERSION4, DWARF, GetCFIData(), GetGNUEHPointer(), HandleCommonDwarfOpcode(), IsCIEMarker(), LLDB_INVALID_ADDRESS, m_cfi_data, m_cfi_data_initialized, m_section_sp, m_type, and lldb_private::Debugger::ReportError().
Referenced by GetCIE(), and GetFDEIndex().
|
private |
Definition at line 580 of file DWARFCallFrameInfo.cpp.
References DW_EH_PE_MASK_ENCODING, EH, lldb_private::DWARFCallFrameInfo::FDE::for_signal_trap, GetCFIData(), GetCIE(), lldb_private::Address::GetFileAddress(), GetGNUEHPointer(), lldb_private::GetLog(), lldb_private::UnwindPlan::Row::GetOffset(), HandleCommonDwarfOpcode(), LLDB_INVALID_ADDRESS, LLDB_LOG, m_cfi_data, m_cfi_data_initialized, m_objfile, m_section_sp, m_type, lldb_private::DWARFCallFrameInfo::FDE::range, lldb_private::UnwindPlan::Row::RemoveRegisterInfo(), lldb_private::DWARFCallFrameInfo::FDE::return_addr_reg_num, lldb_private::DWARFCallFrameInfo::FDE::rows, lldb_private::AddressRange::SetByteSize(), lldb_private::UnwindPlan::Row::AbstractRegisterLocation::SetIsCFAPlusOffset(), lldb_private::UnwindPlan::Row::SetOffset(), lldb_private::UnwindPlan::Row::SetRegisterInfo(), lldb_private::UnwindPlan::Row::SlideOffset(), and lldb_private::Unwind.
Referenced by GetUnwindPlan().
|
private |
Definition at line 167 of file DWARFCallFrameInfo.h.
Referenced by GetCFIData(), GetFDEIndex(), HandleCommonDwarfOpcode(), ParseCIE(), and ParseFDE().
|
private |
Definition at line 168 of file DWARFCallFrameInfo.h.
Referenced by GetCFIData(), GetFDEIndex(), ParseCIE(), and ParseFDE().
|
private |
Definition at line 165 of file DWARFCallFrameInfo.h.
Referenced by GetCIE(), and GetFDEIndex().
|
private |
Definition at line 170 of file DWARFCallFrameInfo.h.
Referenced by ForEachFDEEntries(), GetAddressRange(), GetFDEIndex(), GetFirstFDEEntryInRange(), and GetFunctionAddressAndSizeVector().
|
private |
Definition at line 171 of file DWARFCallFrameInfo.h.
Referenced by GetFDEIndex().
|
private |
Definition at line 172 of file DWARFCallFrameInfo.h.
Referenced by GetFDEIndex().
|
private |
Definition at line 164 of file DWARFCallFrameInfo.h.
|
private |
Definition at line 162 of file DWARFCallFrameInfo.h.
Referenced by DWARFCallFrameInfo(), GetAddressRange(), GetCFIData(), GetFDEIndex(), GetUnwindPlan(), and ParseFDE().
|
private |
Definition at line 163 of file DWARFCallFrameInfo.h.
Referenced by DWARFCallFrameInfo(), GetAddressRange(), GetCFIData(), GetFDEIndex(), GetFirstFDEEntryInRange(), ParseCIE(), and ParseFDE().
|
private |
Definition at line 174 of file DWARFCallFrameInfo.h.
Referenced by DWARFCallFrameInfo(), GetFDEIndex(), GetRegisterKind(), GetUnwindPlan(), ParseCIE(), and ParseFDE().