LLDB mainline
lldb_private::DWARFCallFrameInfo Class Reference

#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 &section, Type type)
 ~DWARFCallFrameInfo ()=default
bool GetAddressRange (Address addr, AddressRange &range)
std::unique_ptr< UnwindPlanGetUnwindPlan (const Address &addr)
 Return an UnwindPlan based on the call frame information encoded in the FDE of this DWARFCallFrameInfo section.
std::unique_ptr< UnwindPlanGetUnwindPlan (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< 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 ()
std::optional< FDEParseFDE (dw_offset_t offset, const Address &startaddr)
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 120 of file DWARFCallFrameInfo.h.

◆ CIESP

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

Definition at line 118 of file DWARFCallFrameInfo.h.

◆ FDEEntryMap

◆ FunctionAddressAndSizeVector

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
CFI_AUG_MAX_SIZE 
CFI_HEADER_SIZE 

Definition at line 83 of file DWARFCallFrameInfo.h.

◆ CFIVersion

Enumerator
CFI_VERSION1 
CFI_VERSION3 
CFI_VERSION4 

Definition at line 84 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 169 of file DWARFCallFrameInfo.cpp.

References m_objfile, m_section_sp, and m_type.

◆ ~DWARFCallFrameInfo()

lldb_private::DWARFCallFrameInfo::~DWARFCallFrameInfo ( )
default

Member Function Documentation

◆ ForEachFDEEntries()

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

◆ GetAddressRange()

◆ GetCFIData()

void DWARFCallFrameInfo::GetCFIData ( )
private

◆ GetCIE()

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

Definition at line 284 of file DWARFCallFrameInfo.cpp.

References m_cie_map, and ParseCIE().

Referenced by GetFDEIndex(), and ParseFDE().

◆ GetFDEIndex()

◆ GetFirstFDEEntryInRange()

◆ GetFunctionAddressAndSizeVector()

◆ GetRegisterKind()

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

Definition at line 173 of file DWARFCallFrameInfo.h.

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

Referenced by GetUnwindPlan().

◆ GetUnwindPlan() [1/2]

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

◆ GetUnwindPlan() [2/2]

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

◆ HandleCommonDwarfOpcode()

◆ IsEHFrame()

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

◆ ParseCIE()

◆ ParseFDE()

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 162 of file DWARFCallFrameInfo.h.

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

◆ m_cie_map

cie_map_t lldb_private::DWARFCallFrameInfo::m_cie_map
private

Definition at line 159 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 165 of file DWARFCallFrameInfo.h.

Referenced by GetFDEIndex().

◆ m_fde_index_mutex

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

Definition at line 166 of file DWARFCallFrameInfo.h.

Referenced by GetFDEIndex().

◆ m_flags

Flags lldb_private::DWARFCallFrameInfo::m_flags = 0
private

Definition at line 158 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

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