LLDB mainline
lldb_private::plugin::dwarf::DWARFUnit Class Referenceabstract

#include <DWARFUnit.h>

Inheritance diagram for lldb_private::plugin::dwarf::DWARFUnit:
[legend]

Classes

class  ScopedExtractDIEs

Public Member Functions

virtual ~DWARFUnit ()
bool IsDWOUnit ()
std::optional< uint64_t > GetDWOId ()
 Get the DWO ID from the DWARFUnitHeader for DWARF5, or from the unit DIE's DW_AT_dwo_id or DW_AT_GNU_dwo_id for DWARF4 and earlier.
std::optional< uint64_t > GetHeaderDWOId ()
 Get the DWO ID from the DWARFUnitHeader only.
void ExtractUnitDIEIfNeeded ()
void ExtractUnitDIENoDwoIfNeeded ()
void ExtractDIEsIfNeeded ()
ScopedExtractDIEs ExtractDIEsScoped ()
bool Verify (Stream *s) const
virtual void Dump (Stream *s) const =0
const DWARFDataExtractorGetData () const
 Get the data that contains the DIE information for this unit.
uint32_t GetHeaderByteSize () const
 Get the size in bytes of the unit header.
dw_offset_t GetOffset () const
size_t GetLengthByteSize () const
 Get the size in bytes of the length field in the header.
bool ContainsDIEOffset (dw_offset_t die_offset) const
dw_offset_t GetFirstDIEOffset () const
dw_offset_t GetNextUnitOffset () const
size_t GetDebugInfoSize () const
dw_offset_t GetLength () const
uint16_t GetVersion () const override
const llvm::dwarf::FormParams & GetFormParams () const
const llvm::DWARFAbbreviationDeclarationSet * GetAbbreviations () const
dw_offset_t GetAbbrevOffset () const
uint8_t GetAddressByteSize () const override
dw_addr_t GetAddrBase () const
dw_addr_t GetBaseAddress () const override
dw_offset_t GetLineTableOffset ()
dw_addr_t GetRangesBase () const
dw_addr_t GetStrOffsetsBase () const
void SetAddrBase (dw_addr_t addr_base)
void SetLoclistsBase (dw_addr_t loclists_base)
void SetRangesBase (dw_addr_t ranges_base)
void SetStrOffsetsBase (dw_offset_t str_offsets_base)
virtual void BuildAddressRangeTable (DWARFDebugAranges *debug_aranges)=0
dw_addr_t ReadAddressFromDebugAddrSection (uint32_t index) const override
lldb::ByteOrder GetByteOrder () const
const DWARFDebugArangesGetFunctionAranges ()
void SetBaseAddress (dw_addr_t base_addr)
DWARFBaseDIE GetUnitDIEOnly ()
DWARFDIE DIE ()
DWARFDIE GetDIE (dw_offset_t die_offset)
llvm::StringRef PeekDIEName (dw_offset_t die_offset)
 Returns the AT_Name of the DIE at die_offset, if it exists, without parsing the entire compile unit.
llvm::Expected< std::pair< uint64_t, bool > > GetDIEBitSizeAndSign (uint64_t relative_die_offset) const override
lldb::offset_t GetVendorDWARFOpcodeSize (const DataExtractor &data, const lldb::offset_t data_offset, const uint8_t op) const override
virtual bool ParseVendorDWARFOpcode (uint8_t op, const DataExtractor &opcodes, lldb::offset_t &offset, RegisterContext *reg_ctx, lldb::RegisterKind reg_kind, std::vector< Value > &stack) const override
bool ParseDWARFLocationList (const DataExtractor &data, DWARFExpressionList &loc_list) const
DWARFUnitGetNonSkeletonUnit ()
lldb_private::CompileUnitGetLLDBCompUnit () const
void SetLLDBCompUnit (lldb_private::CompileUnit *cu)
DWARFCompileUnitGetSkeletonUnit ()
 Get the skeleton compile unit for a DWO file.
bool LinkToSkeletonUnit (DWARFUnit &skeleton_unit)
bool Supports_unnamed_objc_bitfields ()
SymbolFileDWARFGetSymbolFileDWARF () const
DWARFProducer GetProducer ()
llvm::VersionTuple GetProducerVersion ()
uint64_t GetDWARFLanguageType ()
bool GetIsOptimized ()
const FileSpecGetCompilationDirectory ()
const FileSpecGetAbsolutePath ()
FileSpec GetFile (size_t file_idx)
FileSpec::Style GetPathStyle ()
SymbolFileDWARFDwoGetDwoSymbolFile (bool load_all_debug_info=true)
die_iterator_range dies ()
DIERef::Section GetDebugSection () const
uint8_t GetUnitType () const
bool IsTypeUnit () const
bool IsSkeletonUnit () const
 Note that this check only works for DWARF5+.
std::optional< uint64_t > GetStringOffsetSectionItem (uint32_t index) const
llvm::Expected< llvm::DWARFAddressRangesVector > FindRnglistFromOffset (dw_offset_t offset)
 Return a list of address ranges resulting from a (possibly encoded) range list starting at a given offset in the appropriate ranges section.
llvm::Expected< llvm::DWARFAddressRangesVector > FindRnglistFromIndex (uint32_t index)
 Return a list of address ranges retrieved from an encoded range list whose offset is found via a table lookup given an index (DWARF v5 and later).
llvm::Expected< uint64_t > GetRnglistOffset (uint32_t Index)
 Return a rangelist's offset based on an index.
std::optional< uint64_t > GetLoclistOffset (uint32_t Index)
std::unique_ptr< llvm::DWARFLocationTable > GetLocationTable (const DataExtractor &data) const
 Return the location table for parsing the given location list data.
DWARFDataExtractor GetLocationData () const
bool HasAny (llvm::ArrayRef< dw_tag_t > tags)
 Returns true if any DIEs in the unit match any DW_TAG values in tags.
const StatusGetDwoError () const
 Get the fission .dwo file specific error for this compile unit.
void SetDwoError (Status &&error)
 Set the fission .dwo file specific error for this compile unit.
Public Member Functions inherited from lldb_private::DWARFExpression::Delegate
 Delegate ()=default
virtual ~Delegate ()=default
virtual bool ParseVendorDWARFOpcode (uint8_t op, const DataExtractor &opcodes, lldb::offset_t &offset, RegisterContext *reg_ctx, lldb::RegisterKind reg_kind, Stack &stack) const =0
 Delegate (const Delegate &)=delete
Delegateoperator= (const Delegate &)=delete
Public Member Functions inherited from lldb_private::UserID
 UserID (lldb::user_id_t uid=LLDB_INVALID_UID)
 Construct with optional user ID.
 ~UserID ()=default
 Destructor.
void Clear ()
 Clears the object state.
lldb::user_id_t GetID () const
 Get accessor for the user ID.
void SetID (lldb::user_id_t uid)
 Set accessor for the user ID.

Static Public Member Functions

static llvm::Expected< DWARFUnitSPextract (SymbolFileDWARF &dwarf2Data, lldb::user_id_t uid, const DWARFDataExtractor &debug_info, DIERef::Section section, lldb::offset_t *offset_ptr)
static uint8_t GetAddressByteSize (const DWARFUnit *cu)
static uint8_t GetDefaultAddressSize ()

Protected Member Functions

 DWARFUnit (SymbolFileDWARF &dwarf, lldb::user_id_t uid, const llvm::DWARFUnitHeader &header, const llvm::DWARFAbbreviationDeclarationSet &abbrevs, DIERef::Section section, bool is_dwo)
llvm::Error ExtractHeader (SymbolFileDWARF &dwarf, const DWARFDataExtractor &data, lldb::offset_t *offset_ptr)
const DWARFDebugInfoEntryGetUnitDIEPtrOnly ()
const DWARFDebugInfoEntryDIEPtr ()
const std::optional< llvm::DWARFDebugRnglistTable > & GetRnglistTable ()
DWARFDataExtractor GetRnglistData () const

Protected Attributes

SymbolFileDWARFm_dwarf
std::shared_ptr< DWARFUnitm_dwo
llvm::DWARFUnitHeader m_header
const llvm::DWARFAbbreviationDeclarationSet * m_abbrevs = nullptr
lldb_private::CompileUnitm_lldb_cu = nullptr
std::atomic< DWARFUnit * > m_skeleton_unit = nullptr
DWARFDebugInfoEntry::collection m_die_array
llvm::sys::RWMutex m_die_array_mutex
llvm::sys::Mutex m_die_array_scoped_mutex
int m_die_array_scoped_count = 0
std::atomic< boolm_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
DWARFProducer m_producer = eProducerInvalid
llvm::VersionTuple m_producer_version
std::optional< uint64_t > m_language_type
LazyBool m_is_optimized = eLazyBoolCalculate
std::optional< FileSpecm_comp_dir
std::optional< FileSpecm_file_spec
std::optional< dw_addr_tm_addr_base
 Value of DW_AT_addr_base.
dw_addr_t m_loclists_base = 0
 Value of DW_AT_loclists_base.
dw_addr_t m_ranges_base = 0
 Value of DW_AT_rnglists_base.
std::optional< uint64_t > m_gnu_addr_base
std::optional< uint64_t > m_gnu_ranges_base
dw_offset_t m_line_table_offset = DW_INVALID_OFFSET
 Value of DW_AT_stmt_list.
dw_offset_t m_str_offsets_base = 0
std::optional< llvm::DWARFDebugRnglistTable > m_rnglist_table
bool m_rnglist_table_done = false
std::optional< llvm::DWARFListTableHeader > m_loclist_table_header
const DIERef::Section m_section
bool m_is_dwo
bool m_has_parsed_non_skeleton_unit
std::optional< uint64_t > m_dwo_id
 Value of DW_AT_GNU_dwo_id (v4) or dwo_id from CU header (v5).
Status m_dwo_error
 If we get an error when trying to load a .dwo file, save that error here.
Protected Attributes inherited from lldb_private::UserID
lldb::user_id_t m_uid
 The user ID that uniquely identifies an object.

Private Types

using die_iterator_range

Private Member Functions

void ParseProducerInfo ()
void ExtractDIEsRWLocked ()
void ClearDIEsRWLocked ()
void AddUnitDIE (const DWARFDebugInfoEntry &cu_die)
void SetDwoStrOffsetsBase ()
void ComputeCompDirAndGuessPathStyle ()
void ComputeAbsolutePath ()
 DWARFUnit (const DWARFUnit &)=delete
const DWARFUnitoperator= (const DWARFUnit &)=delete

Detailed Description

Definition at line 43 of file DWARFUnit.h.

Member Typedef Documentation

◆ die_iterator_range

Initial value:
llvm::iterator_range<DWARFDebugInfoEntry::collection::iterator>

Definition at line 44 of file DWARFUnit.h.

Constructor & Destructor Documentation

◆ ~DWARFUnit()

DWARFUnit::~DWARFUnit ( )
virtualdefault

◆ DWARFUnit() [1/2]

◆ DWARFUnit() [2/2]

lldb_private::plugin::dwarf::DWARFUnit::DWARFUnit ( const DWARFUnit & )
privatedelete

References DWARFUnit().

Member Function Documentation

◆ AddUnitDIE()

◆ BuildAddressRangeTable()

virtual void lldb_private::plugin::dwarf::DWARFUnit::BuildAddressRangeTable ( DWARFDebugAranges * debug_aranges)
pure virtual

◆ ClearDIEsRWLocked()

void DWARFUnit::ClearDIEsRWLocked ( )
private

Definition at line 627 of file DWARFUnit.cpp.

References m_die_array, and m_dwo.

◆ ComputeAbsolutePath()

void DWARFUnit::ComputeAbsolutePath ( )
private

◆ ComputeCompDirAndGuessPathStyle()

◆ ContainsDIEOffset()

bool lldb_private::plugin::dwarf::DWARFUnit::ContainsDIEOffset ( dw_offset_t die_offset) const
inline

◆ DIE()

◆ DIEPtr()

const DWARFDebugInfoEntry * lldb_private::plugin::dwarf::DWARFUnit::DIEPtr ( )
inlineprotected

Definition at line 315 of file DWARFUnit.h.

References ExtractDIEsIfNeeded(), and m_die_array.

Referenced by DIE(), and GetFunctionAranges().

◆ dies()

die_iterator_range lldb_private::plugin::dwarf::DWARFUnit::dies ( )
inline

◆ Dump()

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

◆ extract()

◆ ExtractDIEsIfNeeded()

void DWARFUnit::ExtractDIEsIfNeeded ( )

Definition at line 151 of file DWARFUnit.cpp.

References ExtractDIEsRWLocked(), m_cancel_scopes, m_die_array, and m_die_array_mutex.

Referenced by DIEPtr(), dies(), and GetDIE().

◆ ExtractDIEsRWLocked()

◆ ExtractDIEsScoped()

◆ ExtractHeader()

llvm::Error lldb_private::plugin::dwarf::DWARFUnit::ExtractHeader ( SymbolFileDWARF & dwarf,
const DWARFDataExtractor & data,
lldb::offset_t * offset_ptr )
protected

◆ ExtractUnitDIEIfNeeded()

◆ ExtractUnitDIENoDwoIfNeeded()

void DWARFUnit::ExtractUnitDIENoDwoIfNeeded ( )

◆ FindRnglistFromIndex()

llvm::Expected< llvm::DWARFAddressRangesVector > DWARFUnit::FindRnglistFromIndex ( uint32_t index)

Return a list of address ranges retrieved from an encoded range list whose offset is found via a table lookup given an index (DWARF v5 and later).

Definition at line 1129 of file DWARFUnit.cpp.

References FindRnglistFromOffset(), and GetRnglistOffset().

Referenced by GetRanges().

◆ FindRnglistFromOffset()

llvm::Expected< llvm::DWARFAddressRangesVector > DWARFUnit::FindRnglistFromOffset ( dw_offset_t offset)

Return a list of address ranges resulting from a (possibly encoded) range list starting at a given offset in the appropriate ranges section.

Definition at line 1089 of file DWARFUnit.cpp.

References GetAddrBase(), GetAddressByteSize(), lldb_private::DWARFDataExtractor::GetAsLLVMDWARF(), GetBaseAddress(), GetRnglistData(), GetRnglistTable(), GetVersion(), m_dwarf, and m_header.

Referenced by FindRnglistFromIndex(), and GetRanges().

◆ GetAbbreviations()

const llvm::DWARFAbbreviationDeclarationSet * DWARFUnit::GetAbbreviations ( ) const

◆ GetAbbrevOffset()

dw_offset_t DWARFUnit::GetAbbrevOffset ( ) const

◆ GetAbsolutePath()

const FileSpec & DWARFUnit::GetAbsolutePath ( )

Definition at line 908 of file DWARFUnit.cpp.

References ComputeAbsolutePath(), and m_file_spec.

◆ GetAddrBase()

dw_addr_t lldb_private::plugin::dwarf::DWARFUnit::GetAddrBase ( ) const
inline

Definition at line 130 of file DWARFUnit.h.

References m_addr_base.

Referenced by FindRnglistFromOffset(), and ReadAddressFromDebugAddrSection().

◆ GetAddressByteSize() [1/2]

◆ GetAddressByteSize() [2/2]

uint8_t DWARFUnit::GetAddressByteSize ( const DWARFUnit * cu)
static

Definition at line 789 of file DWARFUnit.cpp.

References DWARFUnit(), GetAddressByteSize(), and GetDefaultAddressSize().

◆ GetBaseAddress()

dw_addr_t lldb_private::plugin::dwarf::DWARFUnit::GetBaseAddress ( ) const
inlineoverridevirtual

◆ GetByteOrder()

lldb::ByteOrder DWARFUnit::GetByteOrder ( ) const

Definition at line 635 of file DWARFUnit.cpp.

References m_dwarf.

Referenced by GetExprListFromAtConstValue().

◆ GetCompilationDirectory()

const FileSpec & DWARFUnit::GetCompilationDirectory ( )

◆ GetData()

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

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.

Definition at line 1072 of file DWARFUnit.cpp.

References lldb_private::plugin::dwarf::DIERef::DebugTypes, m_dwarf, and m_section.

Referenced by ExtractDIEsRWLocked(), lldb_private::plugin::dwarf::DWARFAttributes::ExtractFormValueAtIndex(), ExtractUnitDIENoDwoIfNeeded(), lldb_private::plugin::dwarf::DWARFDebugInfoEntry::GetAttributeValue(), lldb_private::plugin::dwarf::DWARFDebugInfoEntry::GetDIENamesAndRanges(), and PeekDIEName().

◆ GetDebugInfoSize()

size_t DWARFUnit::GetDebugInfoSize ( ) const

Definition at line 444 of file DWARFUnit.cpp.

References GetHeaderByteSize(), GetLength(), and GetLengthByteSize().

Referenced by ExtractDIEsRWLocked().

◆ GetDebugSection()

DIERef::Section lldb_private::plugin::dwarf::DWARFUnit::GetDebugSection ( ) const
inline

Definition at line 222 of file DWARFUnit.h.

References m_section.

Referenced by lldb_private::plugin::dwarf::NameToDIE::FindAllEntriesForUnit().

◆ GetDefaultAddressSize()

uint8_t DWARFUnit::GetDefaultAddressSize ( )
static

Definition at line 795 of file DWARFUnit.cpp.

Referenced by GetAddressByteSize().

◆ GetDIE()

◆ GetDIEBitSizeAndSign()

llvm::Expected< std::pair< uint64_t, bool > > DWARFUnit::GetDIEBitSizeAndSign ( uint64_t relative_die_offset) const
overridevirtual

◆ GetDWARFLanguageType()

◆ GetDwoError()

const Status & lldb_private::plugin::dwarf::DWARFUnit::GetDwoError ( ) const
inline

Get the fission .dwo file specific error for this compile unit.

The skeleton compile unit only can have a DWO error. Any other type of DWARFUnit will not have a valid DWO error.

Returns
A valid DWO error if there is a problem with anything in the locating or parsing inforamtion in the .dwo file

Definition at line 284 of file DWARFUnit.h.

References m_dwo_error.

Referenced by lldb_private::plugin::dwarf::SymbolFileDWARF::CalculateFrameVariableError(), lldb_private::plugin::dwarf::SymbolFileDWARF::GetDwoStats(), and lldb_private::plugin::dwarf::SymbolFileDWARF::GetSeparateDebugInfo().

◆ GetDWOId()

◆ GetDwoSymbolFile()

◆ GetFile()

◆ GetFirstDIEOffset()

dw_offset_t lldb_private::plugin::dwarf::DWARFUnit::GetFirstDIEOffset ( ) const
inline

◆ GetFormParams()

const llvm::dwarf::FormParams & lldb_private::plugin::dwarf::DWARFUnit::GetFormParams ( ) const
inline

Definition at line 122 of file DWARFUnit.h.

References m_header.

Referenced by lldb_private::plugin::dwarf::DWARFFormValue::SkipValue().

◆ GetFunctionAranges()

◆ GetHeaderByteSize()

uint32_t DWARFUnit::GetHeaderByteSize ( ) const

Get the size in bytes of the unit header.

Returns
Byte size of the unit header

Definition at line 1078 of file DWARFUnit.cpp.

References m_header.

Referenced by GetDebugInfoSize(), and GetFirstDIEOffset().

◆ GetHeaderDWOId()

std::optional< uint64_t > lldb_private::plugin::dwarf::DWARFUnit::GetHeaderDWOId ( )
inline

Get the DWO ID from the DWARFUnitHeader only.

DWARF5 skeleton units have the DWO ID in the compile unit header and we sometimes only want to access this cheap value without causing the more expensive attribute fetches that GetDWOId() uses.

Definition at line 62 of file DWARFUnit.h.

References m_header.

◆ GetIsOptimized()

◆ GetLength()

dw_offset_t lldb_private::plugin::dwarf::DWARFUnit::GetLength ( ) const
inline

◆ GetLengthByteSize()

size_t lldb_private::plugin::dwarf::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 107 of file DWARFUnit.h.

Referenced by GetDebugInfoSize().

◆ GetLineTableOffset()

◆ GetLLDBCompUnit()

◆ GetLocationData()

◆ GetLocationTable()

std::unique_ptr< llvm::DWARFLocationTable > DWARFUnit::GetLocationTable ( const DataExtractor & data) const

Return the location table for parsing the given location list data.

The format is chosen according to the unit type. Never returns null.

Definition at line 525 of file DWARFUnit.cpp.

References lldb::eByteOrderLittle, lldb_private::DataExtractor::GetAddressByteSize(), lldb_private::DataExtractor::GetByteOrder(), lldb_private::DataExtractor::GetData(), GetVersion(), and m_is_dwo.

Referenced by ParseDWARFLocationList().

◆ GetLoclistOffset()

std::optional< uint64_t > lldb_private::plugin::dwarf::DWARFUnit::GetLoclistOffset ( uint32_t Index)
inline

Definition at line 249 of file DWARFUnit.h.

References m_dwarf, m_loclist_table_header, and m_loclists_base.

Referenced by GetExprListFromAtLocation().

◆ GetNextUnitOffset()

◆ GetNonSkeletonUnit()

◆ GetOffset()

◆ GetPathStyle()

◆ GetProducer()

DWARFProducer DWARFUnit::GetProducer ( )

◆ GetProducerVersion()

llvm::VersionTuple DWARFUnit::GetProducerVersion ( )

Definition at line 864 of file DWARFUnit.cpp.

References m_producer_version, and ParseProducerInfo().

Referenced by Supports_unnamed_objc_bitfields().

◆ GetRangesBase()

dw_addr_t lldb_private::plugin::dwarf::DWARFUnit::GetRangesBase ( ) const
inline

Definition at line 133 of file DWARFUnit.h.

References m_ranges_base.

◆ GetRnglistData()

◆ GetRnglistOffset()

llvm::Expected< uint64_t > DWARFUnit::GetRnglistOffset ( uint32_t Index)

Return a rangelist's offset based on an index.

The index designates an entry in the rangelist table's offset array and is supplied by DW_FORM_rnglistx.

Definition at line 589 of file DWARFUnit.cpp.

References GetOffset(), GetRnglistData(), GetRnglistTable(), and m_ranges_base.

Referenced by FindRnglistFromIndex().

◆ GetRnglistTable()

◆ GetSkeletonUnit()

DWARFCompileUnit * DWARFUnit::GetSkeletonUnit ( )

Get the skeleton compile unit for a DWO file.

We need to keep track of the skeleton compile unit for a DWO file so we can access it. Sometimes this value is cached when the skeleton compile unit is first parsed, but if a .dwp file parses all of the DWARFUnits in the file, the skeleton compile unit might not have been parsed yet, to there might not be a backlink. This accessor handles both cases correctly and avoids crashes.

Definition at line 797 of file DWARFUnit.cpp.

References DWARFUnit(), lldb_private::plugin::dwarf::SymbolFileDWARFDwo::GetBaseSymbolFile(), lldb_private::plugin::dwarf::SymbolFileDWARF::GetSkeletonUnit(), GetSymbolFileDWARF(), IsDWOUnit(), LinkToSkeletonUnit(), and m_skeleton_unit.

Referenced by lldb_private::plugin::dwarf::SymbolFileDWARF::GetCompUnitForDWARFCompUnit().

◆ GetStringOffsetSectionItem()

std::optional< uint64_t > DWARFUnit::GetStringOffsetSectionItem ( uint32_t index) const

Definition at line 1081 of file DWARFUnit.cpp.

References GetStrOffsetsBase(), m_dwarf, and m_header.

◆ GetStrOffsetsBase()

dw_addr_t lldb_private::plugin::dwarf::DWARFUnit::GetStrOffsetsBase ( ) const
inline

Definition at line 134 of file DWARFUnit.h.

References m_str_offsets_base.

Referenced by GetStringOffsetSectionItem().

◆ GetSymbolFileDWARF()

◆ GetUnitDIEOnly()

◆ GetUnitDIEPtrOnly()

◆ GetUnitType()

uint8_t lldb_private::plugin::dwarf::DWARFUnit::GetUnitType ( ) const
inline

Definition at line 224 of file DWARFUnit.h.

References m_header.

Referenced by IsSkeletonUnit().

◆ GetVendorDWARFOpcodeSize()

lldb::offset_t DWARFUnit::GetVendorDWARFOpcodeSize ( const DataExtractor & data,
const lldb::offset_t data_offset,
const uint8_t op ) const
overridevirtual

◆ GetVersion()

◆ HasAny()

bool DWARFUnit::HasAny ( llvm::ArrayRef< dw_tag_t > tags)

Returns true if any DIEs in the unit match any DW_TAG values in tags.

Parameters
[in]tagsAn array of dw_tag_t values to check all abbrevitions for.
Returns
True if any DIEs match any tag in tags, false otherwise.

Definition at line 1136 of file DWARFUnit.cpp.

References ExtractUnitDIEIfNeeded(), m_die_array, and m_dwo.

Referenced by lldb_private::plugin::dwarf::SymbolFileDWARF::CalculateFrameVariableError().

◆ IsDWOUnit()

◆ IsSkeletonUnit()

bool lldb_private::plugin::dwarf::DWARFUnit::IsSkeletonUnit ( ) const
inline

Note that this check only works for DWARF5+.

Definition at line 227 of file DWARFUnit.h.

References GetUnitType().

Referenced by lldb_private::plugin::dwarf::ManualDWARFIndex::IndexUnit().

◆ IsTypeUnit()

bool lldb_private::plugin::dwarf::DWARFUnit::IsTypeUnit ( ) const
inline

◆ LinkToSkeletonUnit()

bool DWARFUnit::LinkToSkeletonUnit ( DWARFUnit & skeleton_unit)

Definition at line 811 of file DWARFUnit.cpp.

References DWARFUnit(), and m_skeleton_unit.

Referenced by ExtractUnitDIEIfNeeded(), and GetSkeletonUnit().

◆ operator=()

const DWARFUnit & lldb_private::plugin::dwarf::DWARFUnit::operator= ( const DWARFUnit & )
privatedelete

References DWARFUnit().

◆ ParseDWARFLocationList()

◆ ParseProducerInfo()

◆ ParseVendorDWARFOpcode()

bool DWARFUnit::ParseVendorDWARFOpcode ( uint8_t op,
const DataExtractor & opcodes,
lldb::offset_t & offset,
RegisterContext * reg_ctx,
lldb::RegisterKind reg_kind,
std::vector< Value > & stack ) const
overridevirtual

◆ PeekDIEName()

llvm::StringRef DWARFUnit::PeekDIEName ( dw_offset_t die_offset)

◆ ReadAddressFromDebugAddrSection()

dw_addr_t DWARFUnit::ReadAddressFromDebugAddrSection ( uint32_t index) const
overridevirtual

◆ SetAddrBase()

void DWARFUnit::SetAddrBase ( dw_addr_t addr_base)

Definition at line 462 of file DWARFUnit.cpp.

References m_addr_base.

Referenced by AddUnitDIE(), and ExtractUnitDIEIfNeeded().

◆ SetBaseAddress()

void DWARFUnit::SetBaseAddress ( dw_addr_t base_addr)

Definition at line 639 of file DWARFUnit.cpp.

References m_base_addr.

Referenced by AddUnitDIE(), and ExtractUnitDIEIfNeeded().

◆ SetDwoError()

void lldb_private::plugin::dwarf::DWARFUnit::SetDwoError ( Status && error)
inline

Set the fission .dwo file specific error for this compile unit.

This helps tracks issues that arise when trying to locate or parse a .dwo file. Things like a missing .dwo file, DWO ID mismatch, and other .dwo errors can be stored in each compile unit so the issues can be communicated to the user.

Definition at line 292 of file DWARFUnit.h.

References error(), and m_dwo_error.

Referenced by ExtractUnitDIEIfNeeded(), and lldb_private::plugin::dwarf::SymbolFileDWARF::GetDwoSymbolFileForCompileUnit().

◆ SetDwoStrOffsetsBase()

◆ SetLLDBCompUnit()

void lldb_private::plugin::dwarf::DWARFUnit::SetLLDBCompUnit ( lldb_private::CompileUnit * cu)
inline

◆ SetLoclistsBase()

◆ SetRangesBase()

void DWARFUnit::SetRangesBase ( dw_addr_t ranges_base)

Definition at line 566 of file DWARFUnit.cpp.

References lldbassert, m_ranges_base, and m_rnglist_table_done.

Referenced by AddUnitDIE(), and ExtractUnitDIEIfNeeded().

◆ SetStrOffsetsBase()

void DWARFUnit::SetStrOffsetsBase ( dw_offset_t str_offsets_base)

Definition at line 611 of file DWARFUnit.cpp.

References m_str_offsets_base.

Referenced by AddUnitDIE(), and SetDwoStrOffsetsBase().

◆ Supports_unnamed_objc_bitfields()

bool DWARFUnit::Supports_unnamed_objc_bitfields ( )

◆ Verify()

bool lldb_private::plugin::dwarf::DWARFUnit::Verify ( Stream * s) const

Member Data Documentation

◆ m_abbrevs

const llvm::DWARFAbbreviationDeclarationSet* lldb_private::plugin::dwarf::DWARFUnit::m_abbrevs = nullptr
protected

Definition at line 329 of file DWARFUnit.h.

Referenced by DWARFUnit(), GetAbbreviations(), and GetAbbrevOffset().

◆ m_addr_base

std::optional<dw_addr_t> lldb_private::plugin::dwarf::DWARFUnit::m_addr_base
protected

Value of DW_AT_addr_base.

Definition at line 357 of file DWARFUnit.h.

Referenced by ExtractUnitDIEIfNeeded(), GetAddrBase(), and SetAddrBase().

◆ m_base_addr

dw_addr_t lldb_private::plugin::dwarf::DWARFUnit::m_base_addr = 0
protected

Definition at line 350 of file DWARFUnit.h.

Referenced by AddUnitDIE(), GetBaseAddress(), and SetBaseAddress().

◆ m_cancel_scopes

std::atomic<bool> lldb_private::plugin::dwarf::DWARFUnit::m_cancel_scopes
protected

Definition at line 341 of file DWARFUnit.h.

Referenced by DWARFUnit(), ExtractDIEsIfNeeded(), and ExtractDIEsScoped().

◆ m_comp_dir

std::optional<FileSpec> lldb_private::plugin::dwarf::DWARFUnit::m_comp_dir
protected

◆ m_die_array

DWARFDebugInfoEntry::collection lldb_private::plugin::dwarf::DWARFUnit::m_die_array
protected

◆ m_die_array_mutex

llvm::sys::RWMutex lldb_private::plugin::dwarf::DWARFUnit::m_die_array_mutex
mutableprotected

Definition at line 335 of file DWARFUnit.h.

Referenced by ExtractDIEsIfNeeded(), and ExtractDIEsScoped().

◆ m_die_array_scoped_count

int lldb_private::plugin::dwarf::DWARFUnit::m_die_array_scoped_count = 0
mutableprotected

Definition at line 338 of file DWARFUnit.h.

◆ m_die_array_scoped_mutex

llvm::sys::Mutex lldb_private::plugin::dwarf::DWARFUnit::m_die_array_scoped_mutex
mutableprotected

Definition at line 337 of file DWARFUnit.h.

◆ m_dwarf

◆ m_dwo

std::shared_ptr<DWARFUnit> lldb_private::plugin::dwarf::DWARFUnit::m_dwo
protected

◆ m_dwo_error

Status lldb_private::plugin::dwarf::DWARFUnit::m_dwo_error
protected

If we get an error when trying to load a .dwo file, save that error here.

Errors include .dwo/.dwp file not found, or the .dwp/.dwp file was found but DWO ID doesn't match, etc.

Definition at line 380 of file DWARFUnit.h.

Referenced by ExtractUnitDIEIfNeeded(), GetDwoError(), and SetDwoError().

◆ m_dwo_id

std::optional<uint64_t> lldb_private::plugin::dwarf::DWARFUnit::m_dwo_id
protected

Value of DW_AT_GNU_dwo_id (v4) or dwo_id from CU header (v5).

Definition at line 376 of file DWARFUnit.h.

Referenced by AddUnitDIE(), DWARFUnit(), ExtractUnitDIEIfNeeded(), and GetDWOId().

◆ m_file_spec

std::optional<FileSpec> lldb_private::plugin::dwarf::DWARFUnit::m_file_spec
protected

Definition at line 356 of file DWARFUnit.h.

Referenced by ComputeAbsolutePath(), and GetAbsolutePath().

◆ m_first_die

DWARFDebugInfoEntry lldb_private::plugin::dwarf::DWARFUnit::m_first_die
protected

◆ m_first_die_mutex

llvm::sys::RWMutex lldb_private::plugin::dwarf::DWARFUnit::m_first_die_mutex
protected

Definition at line 346 of file DWARFUnit.h.

Referenced by ExtractDIEsRWLocked(), and ExtractUnitDIENoDwoIfNeeded().

◆ m_func_aranges_up

std::unique_ptr<DWARFDebugAranges> lldb_private::plugin::dwarf::DWARFUnit::m_func_aranges_up
protected

Definition at line 349 of file DWARFUnit.h.

Referenced by GetFunctionAranges().

◆ m_gnu_addr_base

std::optional<uint64_t> lldb_private::plugin::dwarf::DWARFUnit::m_gnu_addr_base
protected

Definition at line 360 of file DWARFUnit.h.

Referenced by AddUnitDIE(), and ExtractUnitDIEIfNeeded().

◆ m_gnu_ranges_base

std::optional<uint64_t> lldb_private::plugin::dwarf::DWARFUnit::m_gnu_ranges_base
protected

Definition at line 361 of file DWARFUnit.h.

Referenced by AddUnitDIE(), and ExtractUnitDIEIfNeeded().

◆ m_has_parsed_non_skeleton_unit

bool lldb_private::plugin::dwarf::DWARFUnit::m_has_parsed_non_skeleton_unit
protected

Definition at line 374 of file DWARFUnit.h.

Referenced by AddUnitDIE(), DWARFUnit(), and ExtractUnitDIEIfNeeded().

◆ m_header

◆ m_is_dwo

bool lldb_private::plugin::dwarf::DWARFUnit::m_is_dwo
protected

Definition at line 373 of file DWARFUnit.h.

Referenced by AddUnitDIE(), DWARFUnit(), GetLocationTable(), and IsDWOUnit().

◆ m_is_optimized

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

Definition at line 354 of file DWARFUnit.h.

Referenced by GetIsOptimized().

◆ m_language_type

std::optional<uint64_t> lldb_private::plugin::dwarf::DWARFUnit::m_language_type
protected

Definition at line 353 of file DWARFUnit.h.

Referenced by GetDWARFLanguageType().

◆ m_line_table_offset

dw_offset_t lldb_private::plugin::dwarf::DWARFUnit::m_line_table_offset = DW_INVALID_OFFSET
protected

Value of DW_AT_stmt_list.

Definition at line 364 of file DWARFUnit.h.

Referenced by AddUnitDIE(), and GetLineTableOffset().

◆ m_lldb_cu

lldb_private::CompileUnit* lldb_private::plugin::dwarf::DWARFUnit::m_lldb_cu = nullptr
protected

Definition at line 330 of file DWARFUnit.h.

Referenced by GetLLDBCompUnit(), and SetLLDBCompUnit().

◆ m_loclist_table_header

std::optional<llvm::DWARFListTableHeader> lldb_private::plugin::dwarf::DWARFUnit::m_loclist_table_header
protected

Definition at line 370 of file DWARFUnit.h.

Referenced by GetLoclistOffset(), and SetLoclistsBase().

◆ m_loclists_base

dw_addr_t lldb_private::plugin::dwarf::DWARFUnit::m_loclists_base = 0
protected

Value of DW_AT_loclists_base.

Definition at line 358 of file DWARFUnit.h.

Referenced by GetLoclistOffset(), and SetLoclistsBase().

◆ m_producer

DWARFProducer lldb_private::plugin::dwarf::DWARFUnit::m_producer = eProducerInvalid
protected

Definition at line 351 of file DWARFUnit.h.

Referenced by GetProducer(), and ParseProducerInfo().

◆ m_producer_version

llvm::VersionTuple lldb_private::plugin::dwarf::DWARFUnit::m_producer_version
protected

Definition at line 352 of file DWARFUnit.h.

Referenced by GetProducerVersion(), and ParseProducerInfo().

◆ m_ranges_base

dw_addr_t lldb_private::plugin::dwarf::DWARFUnit::m_ranges_base = 0
protected

Value of DW_AT_rnglists_base.

Definition at line 359 of file DWARFUnit.h.

Referenced by GetRangesBase(), GetRnglistOffset(), GetRnglistTable(), and SetRangesBase().

◆ m_rnglist_table

std::optional<llvm::DWARFDebugRnglistTable> lldb_private::plugin::dwarf::DWARFUnit::m_rnglist_table
protected

Definition at line 368 of file DWARFUnit.h.

Referenced by GetRnglistTable().

◆ m_rnglist_table_done

bool lldb_private::plugin::dwarf::DWARFUnit::m_rnglist_table_done = false
protected

Definition at line 369 of file DWARFUnit.h.

Referenced by GetRnglistTable(), and SetRangesBase().

◆ m_section

const DIERef::Section lldb_private::plugin::dwarf::DWARFUnit::m_section
protected

Definition at line 372 of file DWARFUnit.h.

Referenced by DWARFUnit(), GetData(), and GetDebugSection().

◆ m_skeleton_unit

std::atomic<DWARFUnit *> lldb_private::plugin::dwarf::DWARFUnit::m_skeleton_unit = nullptr
protected

Definition at line 332 of file DWARFUnit.h.

Referenced by GetSkeletonUnit(), and LinkToSkeletonUnit().

◆ m_str_offsets_base

dw_offset_t lldb_private::plugin::dwarf::DWARFUnit::m_str_offsets_base = 0
protected

Definition at line 366 of file DWARFUnit.h.

Referenced by GetStrOffsetsBase(), and SetStrOffsetsBase().


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