LLDB mainline
Classes | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
lldb_private::DWARFCallFrameInfo Class Reference

#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 &section, 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< CIECIESP
 
typedef std::map< dw_offset_t, CIESPcie_map_t
 
typedef RangeDataVector< lldb::addr_t, uint32_t, dw_offset_tFDEEntryMap
 

Private Member Functions

bool IsEHFrame () const
 
std::optional< FDEEntryMap::EntryGetFirstFDEEntryInRange (const AddressRange &range)
 
void GetFDEIndex ()
 
bool FDEToUnwindPlan (dw_offset_t offset, Address startaddr, UnwindPlan &unwind_plan)
 
const CIEGetCIE (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

ObjectFilem_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
 

Detailed Description

Definition at line 34 of file DWARFCallFrameInfo.h.

Member Typedef Documentation

◆ cie_map_t

Definition at line 117 of file DWARFCallFrameInfo.h.

◆ CIESP

typedef std::shared_ptr<CIE> lldb_private::DWARFCallFrameInfo::CIESP
private

Definition at line 115 of file DWARFCallFrameInfo.h.

◆ FDEEntryMap

Definition at line 122 of file DWARFCallFrameInfo.h.

◆ FunctionAddressAndSizeVector

Definition at line 57 of file DWARFCallFrameInfo.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
CFI_AUG_MAX_SIZE 
CFI_HEADER_SIZE 

Definition at line 80 of file DWARFCallFrameInfo.h.

◆ CFIVersion

Enumerator
CFI_VERSION1 
CFI_VERSION3 
CFI_VERSION4 

Definition at line 81 of file DWARFCallFrameInfo.h.

◆ Type

Enumerator
EH 
DWARF 

Definition at line 36 of file DWARFCallFrameInfo.h.

Constructor & Destructor Documentation

◆ DWARFCallFrameInfo()

DWARFCallFrameInfo::DWARFCallFrameInfo ( ObjectFile objfile,
lldb::SectionSP section,
Type  type 
)

Definition at line 150 of file DWARFCallFrameInfo.cpp.

◆ ~DWARFCallFrameInfo()

lldb_private::DWARFCallFrameInfo::~DWARFCallFrameInfo ( )
default

Member Function Documentation

◆ FDEToUnwindPlan()

bool DWARFCallFrameInfo::FDEToUnwindPlan ( dw_offset_t  offset,
Address  startaddr,
UnwindPlan unwind_plan 
)
private

Definition at line 526 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().

◆ ForEachFDEEntries()

void DWARFCallFrameInfo::ForEachFDEEntries ( const std::function< bool(lldb::addr_t, uint32_t, dw_offset_t)> &  callback)

◆ GetAddressRange()

bool DWARFCallFrameInfo::GetAddressRange ( Address  addr,
AddressRange range 
)

◆ GetCFIData()

void DWARFCallFrameInfo::GetCFIData ( )
private

◆ GetCIE()

const DWARFCallFrameInfo::CIE * DWARFCallFrameInfo::GetCIE ( dw_offset_t  cie_offset)
private

Definition at line 234 of file DWARFCallFrameInfo.cpp.

References m_cie_map, and ParseCIE().

Referenced by FDEToUnwindPlan(), and GetFDEIndex().

◆ GetFDEIndex()

void DWARFCallFrameInfo::GetFDEIndex ( )
private

◆ GetFirstFDEEntryInRange()

std::optional< DWARFCallFrameInfo::FDEEntryMap::Entry > DWARFCallFrameInfo::GetFirstFDEEntryInRange ( const AddressRange range)
private

◆ GetFunctionAddressAndSizeVector()

void DWARFCallFrameInfo::GetFunctionAddressAndSizeVector ( FunctionAddressAndSizeVector function_info)

◆ GetRegisterKind()

lldb::RegisterKind lldb_private::DWARFCallFrameInfo::GetRegisterKind ( ) const
inlineprivate

Definition at line 164 of file DWARFCallFrameInfo.h.

References EH, lldb::eRegisterKindDWARF, lldb::eRegisterKindEHFrame, and m_type.

Referenced by FDEToUnwindPlan().

◆ GetUnwindPlan() [1/2]

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().

◆ GetUnwindPlan() [2/2]

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.

◆ HandleCommonDwarfOpcode()

bool DWARFCallFrameInfo::HandleCommonDwarfOpcode ( uint8_t  primary_opcode,
uint8_t  extended_opcode,
int32_t  data_align,
lldb::offset_t offset,
UnwindPlan::Row row 
)
private

◆ IsEHFrame()

bool lldb_private::DWARFCallFrameInfo::IsEHFrame ( ) const
private

◆ ParseCIE()

DWARFCallFrameInfo::CIESP DWARFCallFrameInfo::ParseCIE ( const dw_offset_t  cie_offset)
private

Member Data Documentation

◆ m_cfi_data

DataExtractor lldb_private::DWARFCallFrameInfo::m_cfi_data
private

◆ m_cfi_data_initialized

bool lldb_private::DWARFCallFrameInfo::m_cfi_data_initialized = false
private

Definition at line 153 of file DWARFCallFrameInfo.h.

Referenced by FDEToUnwindPlan(), GetCFIData(), GetFDEIndex(), and ParseCIE().

◆ m_cie_map

cie_map_t lldb_private::DWARFCallFrameInfo::m_cie_map
private

Definition at line 150 of file DWARFCallFrameInfo.h.

Referenced by GetCIE(), and GetFDEIndex().

◆ m_fde_index

FDEEntryMap lldb_private::DWARFCallFrameInfo::m_fde_index
private

◆ m_fde_index_initialized

bool lldb_private::DWARFCallFrameInfo::m_fde_index_initialized = false
private

Definition at line 156 of file DWARFCallFrameInfo.h.

Referenced by GetFDEIndex().

◆ m_fde_index_mutex

std::mutex lldb_private::DWARFCallFrameInfo::m_fde_index_mutex
private

Definition at line 157 of file DWARFCallFrameInfo.h.

Referenced by GetFDEIndex().

◆ m_flags

Flags lldb_private::DWARFCallFrameInfo::m_flags = 0
private

Definition at line 149 of file DWARFCallFrameInfo.h.

◆ m_objfile

ObjectFile& lldb_private::DWARFCallFrameInfo::m_objfile
private

◆ m_section_sp

lldb::SectionSP lldb_private::DWARFCallFrameInfo::m_section_sp
private

◆ m_type

Type lldb_private::DWARFCallFrameInfo::m_type
private

Definition at line 159 of file DWARFCallFrameInfo.h.

Referenced by FDEToUnwindPlan(), GetFDEIndex(), GetRegisterKind(), and ParseCIE().


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