LLDB mainline
lldb_private::plugin::dwarf::DWARFDebugInfoEntry Class Reference

DWARFDebugInfoEntry objects assume that they are living in one big vector and do pointer arithmetic on their this pointers. More...

#include <DWARFDebugInfoEntry.h>

Public Types

typedef std::vector< DWARFDebugInfoEntrycollection
typedef collection::iterator iterator
typedef collection::const_iterator const_iterator
using Recurse = DWARFBaseDIE::Recurse

Public Member Functions

 DWARFDebugInfoEntry ()
 operator bool () const
bool operator== (const DWARFDebugInfoEntry &rhs) const
bool operator!= (const DWARFDebugInfoEntry &rhs) const
void BuildFunctionAddressRangeTable (DWARFUnit *cu, DWARFDebugAranges *debug_aranges) const
 This function is builds a table very similar to the standard .debug_aranges table, except that the actual DIE offset for the function is placed in the table instead of the compile unit offset.
bool Extract (const DWARFDataExtractor &data, const DWARFUnit &cu, lldb::offset_t *offset_ptr)
DWARFAttributes GetAttributes (const DWARFUnit *cu, Recurse recurse=Recurse::yes) const
 Get all attribute values for a given DIE, optionally following any specifications and abstract origins and including their attributes in the result too.
dw_offset_t GetAttributeValue (const DWARFUnit *cu, const dw_attr_t attr, DWARFFormValue &formValue, dw_offset_t *end_attr_offset_ptr=nullptr, bool check_elaborating_dies=false) const
const char * GetAttributeValueAsString (const DWARFUnit *cu, const dw_attr_t attr, const char *fail_value, bool check_elaborating_dies=false) const
uint64_t GetAttributeValueAsUnsigned (const DWARFUnit *cu, const dw_attr_t attr, uint64_t fail_value, bool check_elaborating_dies=false) const
std::optional< uint64_t > GetAttributeValueAsOptionalUnsigned (const DWARFUnit *cu, const dw_attr_t attr, bool check_elaborating_dies=false) const
DWARFDIE GetAttributeValueAsReference (const DWARFUnit *cu, const dw_attr_t attr, bool check_elaborating_dies=false) const
uint64_t GetAttributeValueAsAddress (const DWARFUnit *cu, const dw_attr_t attr, uint64_t fail_value, bool check_elaborating_dies=false) const
dw_addr_t GetAttributeHighPC (const DWARFUnit *cu, dw_addr_t lo_pc, uint64_t fail_value, bool check_elaborating_dies=false) const
bool GetAttributeAddressRange (const DWARFUnit *cu, dw_addr_t &lo_pc, dw_addr_t &hi_pc, uint64_t fail_value, bool check_elaborating_dies=false) const
llvm::Expected< llvm::DWARFAddressRangesVector > GetAttributeAddressRanges (DWARFUnit *cu, bool check_hi_lo_pc, bool check_elaborating_dies=false) const
const char * GetName (const DWARFUnit *cu) const
const char * GetMangledName (const DWARFUnit *cu, bool substitute_name_allowed=true) const
const char * GetPubname (const DWARFUnit *cu) const
bool GetDIENamesAndRanges (DWARFUnit *cu, const char *&name, const char *&mangled, llvm::DWARFAddressRangesVector &rangeList, std::optional< int > &decl_file, std::optional< int > &decl_line, std::optional< int > &decl_column, std::optional< int > &call_file, std::optional< int > &call_line, std::optional< int > &call_column, DWARFExpressionList *frame_base=nullptr) const
const llvm::DWARFAbbreviationDeclaration * GetAbbreviationDeclarationPtr (const DWARFUnit *cu) const
lldb::offset_t GetFirstAttributeOffset () const
dw_tag_t Tag () const
bool IsNULL () const
dw_offset_t GetOffset () const
bool HasChildren () const
void SetHasChildren (bool b)
DWARFDebugInfoEntryGetParent ()
const DWARFDebugInfoEntryGetParent () const
DWARFDebugInfoEntryGetSibling ()
const DWARFDebugInfoEntryGetSibling () const
DWARFDebugInfoEntryGetFirstChild ()
const DWARFDebugInfoEntryGetFirstChild () const
void SetSiblingIndex (uint32_t idx)
void SetParentIndex (uint32_t idx)
bool IsGlobalOrStaticScopeVariable () const

Protected Attributes

dw_offset_t m_offset: DW_DIE_OFFSET_MAX_BITSIZE
dw_offset_t m_parent_idx: 64 - DW_DIE_OFFSET_MAX_BITSIZE
uint32_t m_sibling_idx: 31
uint32_t m_has_children: 1
uint16_t m_abbr_idx = 0
dw_tag_t m_tag = llvm::dwarf::DW_TAG_null
 A copy of the DW_TAG value so we don't have to go through the compile unit abbrev table.

Detailed Description

DWARFDebugInfoEntry objects assume that they are living in one big vector and do pointer arithmetic on their this pointers.

Don't pass them by value. Due to the way they are constructed in a std::vector, we cannot delete the copy constructor.

Definition at line 34 of file DWARFDebugInfoEntry.h.

Member Typedef Documentation

◆ collection

◆ const_iterator

Definition at line 38 of file DWARFDebugInfoEntry.h.

◆ iterator

Definition at line 37 of file DWARFDebugInfoEntry.h.

◆ Recurse

Constructor & Destructor Documentation

◆ DWARFDebugInfoEntry()

lldb_private::plugin::dwarf::DWARFDebugInfoEntry::DWARFDebugInfoEntry ( )
inline

Member Function Documentation

◆ BuildFunctionAddressRangeTable()

void DWARFDebugInfoEntry::BuildFunctionAddressRangeTable ( DWARFUnit * cu,
DWARFDebugAranges * debug_aranges ) const

This function is builds a table very similar to the standard .debug_aranges table, except that the actual DIE offset for the function is placed in the table instead of the compile unit offset.

Definition at line 614 of file DWARFDebugInfoEntry.cpp.

References lldb_private::plugin::dwarf::DWARFDebugAranges::AppendRange(), BuildFunctionAddressRangeTable(), lldb_private::DebugInfo, DWARFDebugInfoEntry(), GetAttributeAddressRanges(), GetAttributeValueAsOptionalUnsigned(), GetFirstChild(), lldb_private::GetLog(), GetOffset(), GetSibling(), LLDB_LOG_ERROR, and m_tag.

Referenced by BuildFunctionAddressRangeTable(), and lldb_private::plugin::dwarf::DWARFUnit::GetFunctionAranges().

◆ Extract()

◆ GetAbbreviationDeclarationPtr()

const llvm::DWARFAbbreviationDeclaration * DWARFDebugInfoEntry::GetAbbreviationDeclarationPtr ( const DWARFUnit * cu) const

◆ GetAttributeAddressRange()

bool DWARFDebugInfoEntry::GetAttributeAddressRange ( const DWARFUnit * cu,
dw_addr_t & lo_pc,
dw_addr_t & hi_pc,
uint64_t fail_value,
bool check_elaborating_dies = false ) const

◆ GetAttributeAddressRanges()

llvm::Expected< llvm::DWARFAddressRangesVector > DWARFDebugInfoEntry::GetAttributeAddressRanges ( DWARFUnit * cu,
bool check_hi_lo_pc,
bool check_elaborating_dies = false ) const

◆ GetAttributeHighPC()

dw_addr_t DWARFDebugInfoEntry::GetAttributeHighPC ( const DWARFUnit * cu,
dw_addr_t lo_pc,
uint64_t fail_value,
bool check_elaborating_dies = false ) const

◆ GetAttributes()

DWARFAttributes DWARFDebugInfoEntry::GetAttributes ( const DWARFUnit * cu,
Recurse recurse = Recurse::yes ) const

Get all attribute values for a given DIE, optionally following any specifications and abstract origins and including their attributes in the result too.

When following specifications/abstract origins, the attributes on the referring DIE are guaranteed to be visited before the attributes of the referenced DIE.

Parameters
[in]cuDWARFUnit that this entry belongs to.
[in]recurseIf set to Recurse::yes, will include attributes on DIEs referenced via DW_AT_specification and DW_AT_abstract_origin (including across multiple levels of indirection).
Returns
DWARFAttributes that include all attributes found on this DIE (and possibly referenced DIEs). Attributes may appear multiple times (e.g., if a declaration and definition both specify the same attribute). On failure, the returned DWARFAttributes will be empty.

Definition at line 357 of file DWARFDebugInfoEntry.cpp.

References lldb_private::plugin::dwarf::DWARFAttributes::Clear(), and GetAttributes().

Referenced by lldb_private::plugin::dwarf::DWARFUnit::AddUnitDIE(), and GetAttributes().

◆ GetAttributeValue()

◆ GetAttributeValueAsAddress()

uint64_t DWARFDebugInfoEntry::GetAttributeValueAsAddress ( const DWARFUnit * cu,
const dw_attr_t attr,
uint64_t fail_value,
bool check_elaborating_dies = false ) const

◆ GetAttributeValueAsOptionalUnsigned()

std::optional< uint64_t > DWARFDebugInfoEntry::GetAttributeValueAsOptionalUnsigned ( const DWARFUnit * cu,
const dw_attr_t attr,
bool check_elaborating_dies = false ) const

◆ GetAttributeValueAsReference()

DWARFDIE DWARFDebugInfoEntry::GetAttributeValueAsReference ( const DWARFUnit * cu,
const dw_attr_t attr,
bool check_elaborating_dies = false ) const

◆ GetAttributeValueAsString()

◆ GetAttributeValueAsUnsigned()

uint64_t DWARFDebugInfoEntry::GetAttributeValueAsUnsigned ( const DWARFUnit * cu,
const dw_attr_t attr,
uint64_t fail_value,
bool check_elaborating_dies = false ) const

◆ GetDIENamesAndRanges()

◆ GetFirstAttributeOffset()

lldb::offset_t DWARFDebugInfoEntry::GetFirstAttributeOffset ( ) const

Definition at line 640 of file DWARFDebugInfoEntry.cpp.

References GetOffset(), and m_abbr_idx.

Referenced by GetAttributeValue(), and GetDIENamesAndRanges().

◆ GetFirstChild() [1/2]

DWARFDebugInfoEntry * lldb_private::plugin::dwarf::DWARFDebugInfoEntry::GetFirstChild ( )
inline

Definition at line 167 of file DWARFDebugInfoEntry.h.

References DWARFDebugInfoEntry(), and HasChildren().

Referenced by BuildFunctionAddressRangeTable().

◆ GetFirstChild() [2/2]

const DWARFDebugInfoEntry * lldb_private::plugin::dwarf::DWARFDebugInfoEntry::GetFirstChild ( ) const
inline

Definition at line 170 of file DWARFDebugInfoEntry.h.

References DWARFDebugInfoEntry(), and HasChildren().

◆ GetMangledName()

const char * DWARFDebugInfoEntry::GetMangledName ( const DWARFUnit * cu,
bool substitute_name_allowed = true ) const

Definition at line 571 of file DWARFDebugInfoEntry.cpp.

References GetAttributeValueAsString().

◆ GetName()

const char * DWARFDebugInfoEntry::GetName ( const DWARFUnit * cu) const

Definition at line 562 of file DWARFDebugInfoEntry.cpp.

References GetAttributeValueAsString().

◆ GetOffset()

dw_offset_t lldb_private::plugin::dwarf::DWARFDebugInfoEntry::GetOffset ( ) const
inline

◆ GetParent() [1/2]

◆ GetParent() [2/2]

const DWARFDebugInfoEntry * lldb_private::plugin::dwarf::DWARFDebugInfoEntry::GetParent ( ) const
inline

Definition at line 153 of file DWARFDebugInfoEntry.h.

References DWARFDebugInfoEntry(), and m_parent_idx.

◆ GetPubname()

const char * DWARFDebugInfoEntry::GetPubname ( const DWARFUnit * cu) const

Definition at line 594 of file DWARFDebugInfoEntry.cpp.

References GetAttributeValueAsString().

◆ GetSibling() [1/2]

DWARFDebugInfoEntry * lldb_private::plugin::dwarf::DWARFDebugInfoEntry::GetSibling ( )
inline

Definition at line 158 of file DWARFDebugInfoEntry.h.

References DWARFDebugInfoEntry(), and m_sibling_idx.

Referenced by BuildFunctionAddressRangeTable().

◆ GetSibling() [2/2]

const DWARFDebugInfoEntry * lldb_private::plugin::dwarf::DWARFDebugInfoEntry::GetSibling ( ) const
inline

Definition at line 161 of file DWARFDebugInfoEntry.h.

References DWARFDebugInfoEntry(), and m_sibling_idx.

◆ HasChildren()

bool lldb_private::plugin::dwarf::DWARFDebugInfoEntry::HasChildren ( ) const
inline

◆ IsGlobalOrStaticScopeVariable()

bool DWARFDebugInfoEntry::IsGlobalOrStaticScopeVariable ( ) const

Definition at line 657 of file DWARFDebugInfoEntry.cpp.

References DWARFDebugInfoEntry(), GetParent(), and Tag().

◆ IsNULL()

bool lldb_private::plugin::dwarf::DWARFDebugInfoEntry::IsNULL ( ) const
inline

◆ operator bool()

lldb_private::plugin::dwarf::DWARFDebugInfoEntry::operator bool ( ) const
inlineexplicit

Definition at line 44 of file DWARFDebugInfoEntry.h.

References DW_INVALID_OFFSET, and m_offset.

◆ operator!=()

bool DWARFDebugInfoEntry::operator!= ( const DWARFDebugInfoEntry & rhs) const

Definition at line 687 of file DWARFDebugInfoEntry.cpp.

References DWARFDebugInfoEntry().

◆ operator==()

bool DWARFDebugInfoEntry::operator== ( const DWARFDebugInfoEntry & rhs) const

◆ SetHasChildren()

void lldb_private::plugin::dwarf::DWARFDebugInfoEntry::SetHasChildren ( bool b)
inline

Definition at line 146 of file DWARFDebugInfoEntry.h.

References m_has_children.

◆ SetParentIndex()

void lldb_private::plugin::dwarf::DWARFDebugInfoEntry::SetParentIndex ( uint32_t idx)
inline

◆ SetSiblingIndex()

void lldb_private::plugin::dwarf::DWARFDebugInfoEntry::SetSiblingIndex ( uint32_t idx)
inline

Definition at line 174 of file DWARFDebugInfoEntry.h.

References m_sibling_idx.

◆ Tag()

dw_tag_t lldb_private::plugin::dwarf::DWARFDebugInfoEntry::Tag ( ) const
inline

Member Data Documentation

◆ m_abbr_idx

uint16_t lldb_private::plugin::dwarf::DWARFDebugInfoEntry::m_abbr_idx = 0
protected

◆ m_has_children

uint32_t lldb_private::plugin::dwarf::DWARFDebugInfoEntry::m_has_children
protected

◆ m_offset

dw_offset_t lldb_private::plugin::dwarf::DWARFDebugInfoEntry::m_offset
protected

◆ m_parent_idx

dw_offset_t lldb_private::plugin::dwarf::DWARFDebugInfoEntry::m_parent_idx
protected

◆ m_sibling_idx

uint32_t lldb_private::plugin::dwarf::DWARFDebugInfoEntry::m_sibling_idx
protected

◆ m_tag

dw_tag_t lldb_private::plugin::dwarf::DWARFDebugInfoEntry::m_tag = llvm::dwarf::DW_TAG_null
protected

A copy of the DW_TAG value so we don't have to go through the compile unit abbrev table.

Definition at line 196 of file DWARFDebugInfoEntry.h.

Referenced by BuildFunctionAddressRangeTable(), Extract(), operator==(), and Tag().


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