LLDB  mainline
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
DWARFUnit Class Referenceabstract

#include <DWARFUnit.h>

Inheritance diagram for DWARFUnit:
Inheritance graph
[legend]
Collaboration diagram for DWARFUnit:
Collaboration graph
[legend]

Classes

class  ScopedExtractDIEs
 

Public Member Functions

virtual ~DWARFUnit ()
 
void ExtractUnitDIEIfNeeded ()
 
void ExtractDIEsIfNeeded ()
 
ScopedExtractDIEs ExtractDIEsScoped ()
 
DWARFDIE LookupAddress (const dw_addr_t address)
 
size_t AppendDIEsWithTag (const dw_tag_t tag, std::vector< DWARFDIE > &dies, uint32_t depth=UINT32_MAX) const
 
bool Verify (lldb_private::Stream *s) const
 
virtual void Dump (lldb_private::Stream *s) const =0
 
virtual const lldb_private::DWARFDataExtractorGetData () const =0
 Get the data that contains the DIE information for this unit. More...
 
virtual uint32_t GetHeaderByteSize () const =0
 Get the size in bytes of the compile unit header. More...
 
dw_offset_t GetOffset () const
 
size_t GetLengthByteSize () const
 Get the size in bytes of the length field in the header. More...
 
bool ContainsDIEOffset (dw_offset_t die_offset) const
 
dw_offset_t GetFirstDIEOffset () const
 
dw_offset_t GetNextCompileUnitOffset () const
 
size_t GetDebugInfoSize () const
 
uint32_t GetLength () const
 
uint16_t GetVersion () const
 
const DWARFAbbreviationDeclarationSetGetAbbreviations () const
 
dw_offset_t GetAbbrevOffset () const
 
uint8_t GetAddressByteSize () const
 
dw_addr_t GetBaseAddress () const
 
dw_addr_t GetAddrBase () const
 
dw_addr_t GetRangesBase () const
 
dw_addr_t GetStrOffsetsBase () const
 
void SetAddrBase (dw_addr_t addr_base)
 
void SetRangesBase (dw_addr_t ranges_base)
 
void SetBaseObjOffset (dw_offset_t base_obj_offset)
 
void SetStrOffsetsBase (dw_offset_t str_offsets_base)
 
void BuildAddressRangeTable (SymbolFileDWARF *dwarf, DWARFDebugAranges *debug_aranges)
 
lldb::ByteOrder GetByteOrder () const
 
lldb_private::TypeSystemGetTypeSystem ()
 
const DWARFDebugArangesGetFunctionAranges ()
 
DWARFFormValue::FixedFormSizes GetFixedFormSizes ()
 
void SetBaseAddress (dw_addr_t base_addr)
 
DWARFBaseDIE GetUnitDIEOnly ()
 
DWARFDIE DIE ()
 
DWARFDIE GetDIE (dw_offset_t die_offset)
 
void * GetUserData () const
 
void SetUserData (void *d)
 
bool Supports_DW_AT_APPLE_objc_complete_type ()
 
bool DW_AT_decl_file_attributes_are_invalid ()
 
bool Supports_unnamed_objc_bitfields ()
 
SymbolFileDWARFGetSymbolFileDWARF () const
 
DWARFProducer GetProducer ()
 
uint32_t GetProducerVersionMajor ()
 
uint32_t GetProducerVersionMinor ()
 
uint32_t GetProducerVersionUpdate ()
 
lldb::LanguageType GetLanguageType ()
 
bool GetIsOptimized ()
 
const lldb_private::FileSpecGetCompilationDirectory ()
 
lldb_private::FileSpec::Style GetPathStyle ()
 
SymbolFileDWARFDwoGetDwoSymbolFile () const
 
dw_offset_t GetBaseObjOffset () const
 
die_iterator_range dies ()
 
- Public Member Functions inherited from lldb_private::UserID
 UserID (lldb::user_id_t uid=LLDB_INVALID_UID)
 Construct with optional user ID. More...
 
 ~UserID ()
 Destructor. More...
 
void Clear ()
 Clears the object state. More...
 
lldb::user_id_t GetID () const
 Get accessor for the user ID. More...
 
void SetID (lldb::user_id_t uid)
 Set accessor for the user ID. More...
 

Static Public Member Functions

static uint8_t GetAddressByteSize (const DWARFUnit *cu)
 
static uint8_t GetDefaultAddressSize ()
 
static lldb::LanguageType LanguageTypeFromDWARF (uint64_t val)
 

Protected Member Functions

 DWARFUnit (SymbolFileDWARF *dwarf, lldb::user_id_t uid)
 

Protected Attributes

SymbolFileDWARFm_dwarf = nullptr
 
std::unique_ptr< SymbolFileDWARFDwom_dwo_symbol_file
 
const DWARFAbbreviationDeclarationSetm_abbrevs = nullptr
 
void * m_user_data = nullptr
 
DWARFDebugInfoEntry::collection m_die_array
 
llvm::sys::RWMutex m_die_array_mutex
 
llvm::sys::RWMutex m_die_array_scoped_mutex
 
std::atomic< bool > m_cancel_scopes
 
DWARFDebugInfoEntry m_first_die
 
llvm::sys::RWMutex m_first_die_mutex
 
std::unique_ptr< DWARFDebugArangesm_func_aranges_up
 
dw_addr_t m_base_addr = 0
 
dw_offset_t m_length = 0
 
uint16_t m_version = 0
 
uint8_t m_addr_size = 0
 
uint8_t m_unit_type = 0
 
uint64_t m_dwo_id = 0
 
DWARFProducer m_producer = eProducerInvalid
 
uint32_t m_producer_version_major = 0
 
uint32_t m_producer_version_minor = 0
 
uint32_t m_producer_version_update = 0
 
lldb::LanguageType m_language_type = lldb::eLanguageTypeUnknown
 
lldb_private::LazyBool m_is_optimized = lldb_private::eLazyBoolCalculate
 
llvm::Optional< lldb_private::FileSpecm_comp_dir
 
dw_addr_t m_addr_base = 0
 
dw_addr_t m_ranges_base = 0
 
dw_offset_t m_base_obj_offset = DW_INVALID_OFFSET
 
dw_offset_t m_str_offsets_base = 0
 
dw_offset_t m_offset
 
- Protected Attributes inherited from lldb_private::UserID
lldb::user_id_t m_uid
 The user ID that uniquely identifies an object. More...
 

Detailed Description

Definition at line 34 of file DWARFUnit.h.

Constructor & Destructor Documentation

◆ ~DWARFUnit()

DWARFUnit::~DWARFUnit ( )
virtual

Definition at line 35 of file DWARFUnit.cpp.

◆ DWARFUnit()

DWARFUnit::DWARFUnit ( SymbolFileDWARF dwarf,
lldb::user_id_t  uid 
)
protected

Definition at line 32 of file DWARFUnit.cpp.

Referenced by dies().

Member Function Documentation

◆ AppendDIEsWithTag()

size_t DWARFUnit::AppendDIEsWithTag ( const dw_tag_t  tag,
std::vector< DWARFDIE > &  dies,
uint32_t  depth = UINT32_MAX 
) const

Definition at line 351 of file DWARFUnit.cpp.

References m_die_array, and m_die_array_mutex.

Referenced by SymbolFileDWARF::ParseFunctions().

◆ BuildAddressRangeTable()

void DWARFUnit::BuildAddressRangeTable ( SymbolFileDWARF dwarf,
DWARFDebugAranges debug_aranges 
)

◆ ContainsDIEOffset()

bool DWARFUnit::ContainsDIEOffset ( dw_offset_t  die_offset) const
inline

◆ DIE()

DWARFDIE DWARFUnit::DIE ( )
inline

◆ dies()

die_iterator_range DWARFUnit::dies ( )
inline

Definition at line 165 of file DWARFUnit.h.

References DWARFUnit(), ExtractDIEsIfNeeded(), and m_die_array.

◆ Dump()

virtual void DWARFUnit::Dump ( lldb_private::Stream s) const
pure virtual

Implemented in DWARFCompileUnit.

◆ DW_AT_decl_file_attributes_are_invalid()

bool DWARFUnit::DW_AT_decl_file_attributes_are_invalid ( )

Definition at line 574 of file DWARFUnit.cpp.

References eProducerLLVMGCC, and GetProducer().

Referenced by DIE().

◆ ExtractDIEsIfNeeded()

void DWARFUnit::ExtractDIEsIfNeeded ( )

Definition at line 70 of file DWARFUnit.cpp.

References m_cancel_scopes, m_die_array, and m_die_array_mutex.

Referenced by dies(), GetDIE(), and DWARFUnit::ScopedExtractDIEs::operator=().

◆ ExtractDIEsScoped()

DWARFUnit::ScopedExtractDIEs DWARFUnit::ExtractDIEsScoped ( )

◆ ExtractUnitDIEIfNeeded()

void DWARFUnit::ExtractUnitDIEIfNeeded ( )

◆ GetAbbreviations()

const DWARFAbbreviationDeclarationSet * DWARFUnit::GetAbbreviations ( ) const

◆ GetAbbrevOffset()

dw_offset_t DWARFUnit::GetAbbrevOffset ( ) const

Definition at line 381 of file DWARFUnit.cpp.

References DW_INVALID_OFFSET, DWARFAbbreviationDeclarationSet::GetOffset(), and m_abbrevs.

Referenced by GetVersion().

◆ GetAddrBase()

dw_addr_t DWARFUnit::GetAddrBase ( ) const
inline

◆ GetAddressByteSize() [1/2]

uint8_t DWARFUnit::GetAddressByteSize ( ) const
inline

◆ GetAddressByteSize() [2/2]

uint8_t DWARFUnit::GetAddressByteSize ( const DWARFUnit cu)
static

Definition at line 554 of file DWARFUnit.cpp.

References GetAddressByteSize(), and GetDefaultAddressSize().

◆ GetBaseAddress()

dw_addr_t DWARFUnit::GetBaseAddress ( ) const
inline

◆ GetBaseObjOffset()

dw_offset_t DWARFUnit::GetBaseObjOffset ( ) const

Definition at line 771 of file DWARFUnit.cpp.

References m_base_obj_offset.

Referenced by DIE(), and DIERef::DIERef().

◆ GetByteOrder()

lldb::ByteOrder DWARFUnit::GetByteOrder ( ) const

◆ GetCompilationDirectory()

const FileSpec & DWARFUnit::GetCompilationDirectory ( )

Definition at line 702 of file DWARFUnit.cpp.

References m_comp_dir.

Referenced by DIE(), SymbolFileDWARF::ParseCompileUnit(), and DWARFDebugLine::ParseSupportFiles().

◆ GetData()

virtual const lldb_private::DWARFDataExtractor& DWARFUnit::GetData ( ) const
pure virtual

Get the data that contains the DIE information for this unit.

This will return the correct bytes that contain the data for this DWARFUnit. It could be .debug_info or .debug_types depending on where the data for this unit originates.

Returns
The correct data for the DIE information in this unit.

Implemented in DWARFCompileUnit.

Referenced by DWARFDebugInfoEntry::Dump(), DWARFDebugInfoEntry::Extract(), DWARFAttributes::ExtractFormValueAtIndex(), ExtractUnitDIEIfNeeded(), DWARFDebugInfoEntry::GetAbbreviationDeclarationPtr(), DWARFDebugInfoEntry::GetAttributes(), DWARFDebugInfoEntry::GetAttributeValue(), DWARFDebugInfoEntry::GetDIENamesAndRanges(), and DWARFUnit::ScopedExtractDIEs::operator=().

◆ GetDebugInfoSize()

size_t DWARFUnit::GetDebugInfoSize ( ) const

◆ GetDefaultAddressSize()

uint8_t DWARFUnit::GetDefaultAddressSize ( )
static

Definition at line 560 of file DWARFUnit.cpp.

Referenced by DIE(), and GetAddressByteSize().

◆ GetDIE()

DWARFDIE DWARFUnit::GetDIE ( dw_offset_t  die_offset)

◆ GetDwoSymbolFile()

SymbolFileDWARFDwo * DWARFUnit::GetDwoSymbolFile ( ) const

◆ GetFirstDIEOffset()

dw_offset_t DWARFUnit::GetFirstDIEOffset ( ) const
inline

◆ GetFixedFormSizes()

DWARFFormValue::FixedFormSizes DWARFUnit::GetFixedFormSizes ( )

◆ GetFunctionAranges()

const DWARFDebugAranges & DWARFUnit::GetFunctionAranges ( )

◆ GetHeaderByteSize()

virtual uint32_t DWARFUnit::GetHeaderByteSize ( ) const
pure virtual

Get the size in bytes of the compile unit header.

Returns
Byte size of the compile unit header

Implemented in DWARFCompileUnit.

Referenced by GetDebugInfoSize(), and GetFirstDIEOffset().

◆ GetIsOptimized()

bool DWARFUnit::GetIsOptimized ( )

◆ GetLanguageType()

LanguageType DWARFUnit::GetLanguageType ( )

◆ GetLength()

uint32_t DWARFUnit::GetLength ( ) const
inline

Definition at line 96 of file DWARFUnit.h.

References m_length.

Referenced by GetDebugInfoSize(), and GetNextCompileUnitOffset().

◆ GetLengthByteSize()

size_t DWARFUnit::GetLengthByteSize ( ) const
inline

Get the size in bytes of the length field in the header.

In DWARF32 this is just 4 bytes

Returns
Byte size of the compile unit header length field

Definition at line 83 of file DWARFUnit.h.

Referenced by GetDebugInfoSize(), and GetNextCompileUnitOffset().

◆ GetNextCompileUnitOffset()

dw_offset_t DWARFUnit::GetNextCompileUnitOffset ( ) const

◆ GetOffset()

dw_offset_t DWARFUnit::GetOffset ( ) const
inline

◆ GetPathStyle()

FileSpec::Style DWARFUnit::GetPathStyle ( )

Definition at line 696 of file DWARFUnit.cpp.

References m_comp_dir.

Referenced by DIE(), SymbolFileDWARF::ParseCompileUnit(), and DWARFDebugLine::ParseSupportFiles().

◆ GetProducer()

DWARFProducer DWARFUnit::GetProducer ( )

◆ GetProducerVersionMajor()

uint32_t DWARFUnit::GetProducerVersionMajor ( )

Definition at line 641 of file DWARFUnit.cpp.

References m_producer_version_major.

Referenced by DIE(), and Supports_unnamed_objc_bitfields().

◆ GetProducerVersionMinor()

uint32_t DWARFUnit::GetProducerVersionMinor ( )

Definition at line 647 of file DWARFUnit.cpp.

References m_producer_version_minor.

Referenced by DIE().

◆ GetProducerVersionUpdate()

uint32_t DWARFUnit::GetProducerVersionUpdate ( )

Definition at line 653 of file DWARFUnit.cpp.

References m_producer_version_update.

Referenced by DIE(), and Supports_unnamed_objc_bitfields().

◆ GetRangesBase()

dw_addr_t DWARFUnit::GetRangesBase ( ) const
inline

Definition at line 103 of file DWARFUnit.h.

References m_ranges_base.

Referenced by DWARFDebugRanges::FindRanges(), and DWARFDebugRngLists::FindRanges().

◆ GetStrOffsetsBase()

dw_addr_t DWARFUnit::GetStrOffsetsBase ( ) const
inline

◆ GetSymbolFileDWARF()

SymbolFileDWARF * DWARFUnit::GetSymbolFileDWARF ( ) const

◆ GetTypeSystem()

TypeSystem * DWARFUnit::GetTypeSystem ( )

Definition at line 505 of file DWARFUnit.cpp.

References GetLanguageType(), SymbolFileDWARF::GetTypeSystemForLanguage(), and m_dwarf.

Referenced by GetStrOffsetsBase().

◆ GetUnitDIEOnly()

DWARFBaseDIE DWARFUnit::GetUnitDIEOnly ( )
inline

◆ GetUserData()

void * DWARFUnit::GetUserData ( ) const

◆ GetVersion()

uint16_t DWARFUnit::GetVersion ( ) const
inline

◆ LanguageTypeFromDWARF()

LanguageType DWARFUnit::LanguageTypeFromDWARF ( uint64_t  val)
static

◆ LookupAddress()

DWARFDIE DWARFUnit::LookupAddress ( const dw_addr_t  address)

◆ SetAddrBase()

void DWARFUnit::SetAddrBase ( dw_addr_t  addr_base)

Definition at line 385 of file DWARFUnit.cpp.

References m_addr_base.

Referenced by GetStrOffsetsBase(), and SetDwoStrOffsetsBase().

◆ SetBaseAddress()

void DWARFUnit::SetBaseAddress ( dw_addr_t  base_addr)

Definition at line 516 of file DWARFUnit.cpp.

References m_base_addr.

Referenced by GetStrOffsetsBase(), and SetDwoStrOffsetsBase().

◆ SetBaseObjOffset()

void DWARFUnit::SetBaseObjOffset ( dw_offset_t  base_obj_offset)

Definition at line 391 of file DWARFUnit.cpp.

References m_base_obj_offset.

Referenced by GetStrOffsetsBase(), and SetDwoStrOffsetsBase().

◆ SetRangesBase()

void DWARFUnit::SetRangesBase ( dw_addr_t  ranges_base)

Definition at line 387 of file DWARFUnit.cpp.

References m_ranges_base.

Referenced by GetStrOffsetsBase(), and SetDwoStrOffsetsBase().

◆ SetStrOffsetsBase()

void DWARFUnit::SetStrOffsetsBase ( dw_offset_t  str_offsets_base)

Definition at line 395 of file DWARFUnit.cpp.

References m_die_array, m_dwo_symbol_file, and m_str_offsets_base.

Referenced by GetStrOffsetsBase(), and SetDwoStrOffsetsBase().

◆ SetUserData()

void DWARFUnit::SetUserData ( void *  d)

◆ Supports_DW_AT_APPLE_objc_complete_type()

bool DWARFUnit::Supports_DW_AT_APPLE_objc_complete_type ( )

◆ Supports_unnamed_objc_bitfields()

bool DWARFUnit::Supports_unnamed_objc_bitfields ( )

Definition at line 580 of file DWARFUnit.cpp.

References eProducerClang, GetProducer(), GetProducerVersionMajor(), and GetProducerVersionUpdate().

Referenced by DIE().

◆ Verify()

bool DWARFUnit::Verify ( lldb_private::Stream s) const

Member Data Documentation

◆ m_abbrevs

const DWARFAbbreviationDeclarationSet* DWARFUnit::m_abbrevs = nullptr
protected

Definition at line 175 of file DWARFUnit.h.

Referenced by GetAbbreviations(), and GetAbbrevOffset().

◆ m_addr_base

dw_addr_t DWARFUnit::m_addr_base = 0
protected

Definition at line 206 of file DWARFUnit.h.

Referenced by GetAddrBase(), and SetAddrBase().

◆ m_addr_size

uint8_t DWARFUnit::m_addr_size = 0
protected

Definition at line 196 of file DWARFUnit.h.

Referenced by GetAddressByteSize().

◆ m_base_addr

dw_addr_t DWARFUnit::m_base_addr = 0
protected

Definition at line 193 of file DWARFUnit.h.

Referenced by GetBaseAddress(), and SetBaseAddress().

◆ m_base_obj_offset

dw_offset_t DWARFUnit::m_base_obj_offset = DW_INVALID_OFFSET
protected

Definition at line 210 of file DWARFUnit.h.

Referenced by GetBaseObjOffset(), and SetBaseObjOffset().

◆ m_cancel_scopes

std::atomic<bool> DWARFUnit::m_cancel_scopes
protected

◆ m_comp_dir

llvm::Optional<lldb_private::FileSpec> DWARFUnit::m_comp_dir
protected

Definition at line 205 of file DWARFUnit.h.

Referenced by GetCompilationDirectory(), GetPathStyle(), and resolveCompDir().

◆ m_die_array

DWARFDebugInfoEntry::collection DWARFUnit::m_die_array
protected

◆ m_die_array_mutex

llvm::sys::RWMutex DWARFUnit::m_die_array_mutex
mutableprotected

◆ m_die_array_scoped_mutex

llvm::sys::RWMutex DWARFUnit::m_die_array_scoped_mutex
mutableprotected

◆ m_dwarf

SymbolFileDWARF* DWARFUnit::m_dwarf = nullptr
protected

◆ m_dwo_id

uint64_t DWARFUnit::m_dwo_id = 0
protected

Definition at line 198 of file DWARFUnit.h.

◆ m_dwo_symbol_file

std::unique_ptr<SymbolFileDWARFDwo> DWARFUnit::m_dwo_symbol_file
protected

◆ m_first_die

DWARFDebugInfoEntry DWARFUnit::m_first_die
protected

Definition at line 188 of file DWARFUnit.h.

Referenced by ExtractUnitDIEIfNeeded(), and DWARFUnit::ScopedExtractDIEs::operator=().

◆ m_first_die_mutex

llvm::sys::RWMutex DWARFUnit::m_first_die_mutex
protected

Definition at line 189 of file DWARFUnit.h.

Referenced by ExtractUnitDIEIfNeeded(), and DWARFUnit::ScopedExtractDIEs::operator=().

◆ m_func_aranges_up

std::unique_ptr<DWARFDebugAranges> DWARFUnit::m_func_aranges_up
protected

Definition at line 192 of file DWARFUnit.h.

Referenced by GetFunctionAranges().

◆ m_is_optimized

lldb_private::LazyBool DWARFUnit::m_is_optimized = lldb_private::eLazyBoolCalculate
protected

Definition at line 204 of file DWARFUnit.h.

Referenced by GetIsOptimized().

◆ m_language_type

lldb::LanguageType DWARFUnit::m_language_type = lldb::eLanguageTypeUnknown
protected

Definition at line 203 of file DWARFUnit.h.

Referenced by GetLanguageType().

◆ m_length

dw_offset_t DWARFUnit::m_length = 0
protected

Definition at line 194 of file DWARFUnit.h.

Referenced by GetLength().

◆ m_offset

dw_offset_t DWARFUnit::m_offset
protected

◆ m_producer

DWARFProducer DWARFUnit::m_producer = eProducerInvalid
protected

Definition at line 199 of file DWARFUnit.h.

Referenced by GetProducer(), and GetSymbolFileDWARF().

◆ m_producer_version_major

uint32_t DWARFUnit::m_producer_version_major = 0
protected

Definition at line 200 of file DWARFUnit.h.

Referenced by GetProducerVersionMajor(), and GetSymbolFileDWARF().

◆ m_producer_version_minor

uint32_t DWARFUnit::m_producer_version_minor = 0
protected

Definition at line 201 of file DWARFUnit.h.

Referenced by GetProducerVersionMinor(), and GetSymbolFileDWARF().

◆ m_producer_version_update

uint32_t DWARFUnit::m_producer_version_update = 0
protected

Definition at line 202 of file DWARFUnit.h.

Referenced by GetProducerVersionUpdate(), and GetSymbolFileDWARF().

◆ m_ranges_base

dw_addr_t DWARFUnit::m_ranges_base = 0
protected

Definition at line 207 of file DWARFUnit.h.

Referenced by GetRangesBase(), and SetRangesBase().

◆ m_str_offsets_base

dw_offset_t DWARFUnit::m_str_offsets_base = 0
protected

Definition at line 211 of file DWARFUnit.h.

Referenced by GetStrOffsetsBase(), and SetStrOffsetsBase().

◆ m_unit_type

uint8_t DWARFUnit::m_unit_type = 0
protected

Definition at line 197 of file DWARFUnit.h.

◆ m_user_data

void* DWARFUnit::m_user_data = nullptr
protected

Definition at line 176 of file DWARFUnit.h.

Referenced by GetUserData(), and SetUserData().

◆ m_version

uint16_t DWARFUnit::m_version = 0
protected

Definition at line 195 of file DWARFUnit.h.

Referenced by GetVersion().


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