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>

Collaboration diagram for lldb_private::DWARFCallFrameInfo:
Collaboration graph
[legend]

Classes

struct  CIE
 

Public Types

enum  Type { EH, DWARF }
 
typedef RangeVector< lldb::addr_t, uint32_tFunctionAddressAndSizeVector
 

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. More...
 
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. More...
 
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
 
llvm::Optional< FDEEntryMap::EntryGetFirstFDEEntryInRange (const AddressRange &range)
 
void GetFDEIndex ()
 
bool FDEToUnwindPlan (uint32_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 uint32_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 33 of file DWARFCallFrameInfo.h.

Member Typedef Documentation

◆ cie_map_t

Definition at line 115 of file DWARFCallFrameInfo.h.

◆ CIESP

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

Definition at line 113 of file DWARFCallFrameInfo.h.

◆ FDEEntryMap

Definition at line 120 of file DWARFCallFrameInfo.h.

◆ FunctionAddressAndSizeVector

Definition at line 56 of file DWARFCallFrameInfo.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
CFI_AUG_MAX_SIZE 
CFI_HEADER_SIZE 

Definition at line 79 of file DWARFCallFrameInfo.h.

◆ CFIVersion

Enumerator
CFI_VERSION1 
CFI_VERSION3 
CFI_VERSION4 

Definition at line 80 of file DWARFCallFrameInfo.h.

◆ Type

Enumerator
EH 
DWARF 

Definition at line 35 of file DWARFCallFrameInfo.h.

Constructor & Destructor Documentation

◆ DWARFCallFrameInfo()

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

Definition at line 146 of file DWARFCallFrameInfo.cpp.

◆ ~DWARFCallFrameInfo()

lldb_private::DWARFCallFrameInfo::~DWARFCallFrameInfo ( )
default

Member Function Documentation

◆ FDEToUnwindPlan()

bool DWARFCallFrameInfo::FDEToUnwindPlan ( uint32_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::GetLogIfAllCategoriesSet(), 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(), LIBLLDB_LOG_UNWIND, LLDB_INVALID_ADDRESS, LLDB_LOGF, 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, 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 230 of file DWARFCallFrameInfo.cpp.

References m_cie_map, and ParseCIE().

Referenced by FDEToUnwindPlan(), and GetFDEIndex().

◆ GetFDEIndex()

void DWARFCallFrameInfo::GetFDEIndex ( )
private

◆ GetFirstFDEEntryInRange()

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

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

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 150 of file DWARFCallFrameInfo.cpp.

Referenced by lldb_private::FuncUnwinders::GetDebugFrameUnwindPlan(), lldb_private::FuncUnwinders::GetEHFrameUnwindPlan(), and lldb_private::RegisterContextUnwind::GetFullUnwindPlanForFrame().

◆ 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 155 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 uint32_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 151 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 148 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 154 of file DWARFCallFrameInfo.h.

Referenced by GetFDEIndex().

◆ m_fde_index_mutex

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

Definition at line 155 of file DWARFCallFrameInfo.h.

Referenced by GetFDEIndex().

◆ m_flags

Flags lldb_private::DWARFCallFrameInfo::m_flags = 0
private

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

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


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