LLDB  mainline
Public Types | Public Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
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>

Collaboration diagram for DWARFDebugInfoEntry:
Collaboration graph
[legend]

Public Types

typedef std::vector< DWARFDebugInfoEntrycollection
 
typedef collection::iterator iterator
 
typedef collection::const_iterator const_iterator
 

Public Member Functions

 DWARFDebugInfoEntry ()
 
 operator bool () const
 
bool operator== (const DWARFDebugInfoEntry &rhs) const
 
bool operator!= (const DWARFDebugInfoEntry &rhs) const
 
void BuildFunctionAddressRangeTable (const 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. More...
 
bool Extract (const lldb_private::DWARFDataExtractor &data, const DWARFUnit *cu, lldb::offset_t *offset_ptr)
 
size_t GetAttributes (const DWARFUnit *cu, DWARFAttributes &attrs, uint32_t curr_depth=0) const
 
dw_offset_t GetAttributeValue (const DWARFUnit *cu, const dw_attr_t attr, DWARFFormValue &formValue, dw_offset_t *end_attr_offset_ptr=nullptr, bool check_specification_or_abstract_origin=false) const
 
const char * GetAttributeValueAsString (const DWARFUnit *cu, const dw_attr_t attr, const char *fail_value, bool check_specification_or_abstract_origin=false) const
 
uint64_t GetAttributeValueAsUnsigned (const DWARFUnit *cu, const dw_attr_t attr, uint64_t fail_value, bool check_specification_or_abstract_origin=false) const
 
DWARFDIE GetAttributeValueAsReference (const DWARFUnit *cu, const dw_attr_t attr, bool check_specification_or_abstract_origin=false) const
 
uint64_t GetAttributeValueAsAddress (const DWARFUnit *cu, const dw_attr_t attr, uint64_t fail_value, bool check_specification_or_abstract_origin=false) const
 
dw_addr_t GetAttributeHighPC (const DWARFUnit *cu, dw_addr_t lo_pc, uint64_t fail_value, bool check_specification_or_abstract_origin=false) const
 
bool GetAttributeAddressRange (const DWARFUnit *cu, dw_addr_t &lo_pc, dw_addr_t &hi_pc, uint64_t fail_value, bool check_specification_or_abstract_origin=false) const
 
size_t GetAttributeAddressRanges (DWARFUnit *cu, DWARFRangeList &ranges, bool check_hi_lo_pc, bool check_specification_or_abstract_origin=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
 
const char * GetQualifiedName (DWARFUnit *cu, std::string &storage) const
 
const char * GetQualifiedName (DWARFUnit *cu, const DWARFAttributes &attributes, std::string &storage) const
 
bool GetDIENamesAndRanges (DWARFUnit *cu, const char *&name, const char *&mangled, DWARFRangeList &rangeList, int &decl_file, int &decl_line, int &decl_column, int &call_file, int &call_line, int &call_column, lldb_private::DWARFExpression *frame_base=nullptr) const
 
const DWARFAbbreviationDeclarationGetAbbreviationDeclarationPtr (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
 
DWARFDeclContext GetDWARFDeclContext (DWARFUnit *cu) const
 
DWARFDIE GetParentDeclContextDIE (DWARFUnit *cu) const
 
DWARFDIE GetParentDeclContextDIE (DWARFUnit *cu, const DWARFAttributes &attributes) const
 
void SetSiblingIndex (uint32_t idx)
 
void SetParentIndex (uint32_t idx)
 
bool IsGlobalOrStaticScopeVariable () const
 

Static Protected Member Functions

static DWARFDeclContext GetDWARFDeclContextStatic (const DWARFDebugInfoEntry *die, DWARFUnit *cu)
 

Protected Attributes

dw_offset_t m_offset
 
uint32_t m_parent_idx
 
uint32_t m_sibling_idx: 31
 
uint32_t m_has_children: 1
 
uint16_t m_abbr_idx
 
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. More...
 

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 30 of file DWARFDebugInfoEntry.h.

Member Typedef Documentation

◆ collection

Definition at line 32 of file DWARFDebugInfoEntry.h.

◆ const_iterator

typedef collection::const_iterator DWARFDebugInfoEntry::const_iterator

Definition at line 34 of file DWARFDebugInfoEntry.h.

◆ iterator

typedef collection::iterator DWARFDebugInfoEntry::iterator

Definition at line 33 of file DWARFDebugInfoEntry.h.

Constructor & Destructor Documentation

◆ DWARFDebugInfoEntry()

DWARFDebugInfoEntry::DWARFDebugInfoEntry ( )
inline

Definition at line 36 of file DWARFDebugInfoEntry.h.

Member Function Documentation

◆ BuildFunctionAddressRangeTable()

void DWARFDebugInfoEntry::BuildFunctionAddressRangeTable ( const 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 686 of file DWARFDebugInfoEntry.cpp.

References DWARFDebugAranges::AppendRange(), BuildFunctionAddressRangeTable(), GetSibling(), and LLDB_INVALID_ADDRESS.

Referenced by BuildFunctionAddressRangeTable(), DWARFUnit::GetFunctionAranges(), and operator bool().

◆ Extract()

bool DWARFDebugInfoEntry::Extract ( const lldb_private::DWARFDataExtractor data,
const DWARFUnit cu,
lldb::offset_t offset_ptr 
)

◆ GetAbbreviationDeclarationPtr()

const 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_specification_or_abstract_origin = false 
) const

Definition at line 594 of file DWARFDebugInfoEntry.cpp.

Referenced by operator bool().

◆ GetAttributeAddressRanges()

size_t DWARFDebugInfoEntry::GetAttributeAddressRanges ( DWARFUnit cu,
DWARFRangeList ranges,
bool  check_hi_lo_pc,
bool  check_specification_or_abstract_origin = false 
) const

◆ GetAttributeHighPC()

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

◆ GetAttributes()

size_t DWARFDebugInfoEntry::GetAttributes ( const DWARFUnit cu,
DWARFAttributes attrs,
uint32_t  curr_depth = 0 
) const

◆ GetAttributeValue()

dw_offset_t DWARFDebugInfoEntry::GetAttributeValue ( const DWARFUnit cu,
const dw_attr_t  attr,
DWARFFormValue formValue,
dw_offset_t end_attr_offset_ptr = nullptr,
bool  check_specification_or_abstract_origin = false 
) const

◆ GetAttributeValueAsAddress()

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

Definition at line 555 of file DWARFDebugInfoEntry.cpp.

References DWARFFormValue::Address().

Referenced by operator bool().

◆ GetAttributeValueAsReference()

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

Definition at line 545 of file DWARFDebugInfoEntry.cpp.

References DWARFFormValue::Reference().

Referenced by operator bool().

◆ GetAttributeValueAsString()

const char * DWARFDebugInfoEntry::GetAttributeValueAsString ( const DWARFUnit cu,
const dw_attr_t  attr,
const char *  fail_value,
bool  check_specification_or_abstract_origin = false 
) const

◆ GetAttributeValueAsUnsigned()

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

◆ GetDIENamesAndRanges()

bool DWARFDebugInfoEntry::GetDIENamesAndRanges ( DWARFUnit cu,
const char *&  name,
const char *&  mangled,
DWARFRangeList rangeList,
int &  decl_file,
int &  decl_line,
int &  decl_column,
int &  call_file,
int &  call_line,
int &  call_column,
lldb_private::DWARFExpression frame_base = nullptr 
) const

◆ GetDWARFDeclContext()

DWARFDeclContext DWARFDebugInfoEntry::GetDWARFDeclContext ( DWARFUnit cu) const

Definition at line 725 of file DWARFDebugInfoEntry.cpp.

Referenced by GetFirstChild().

◆ GetDWARFDeclContextStatic()

DWARFDeclContext DWARFDebugInfoEntry::GetDWARFDeclContextStatic ( const DWARFDebugInfoEntry die,
DWARFUnit cu 
)
staticprotected

◆ GetFirstAttributeOffset()

lldb::offset_t DWARFDebugInfoEntry::GetFirstAttributeOffset ( ) const

Definition at line 839 of file DWARFDebugInfoEntry.cpp.

Referenced by operator bool().

◆ GetFirstChild() [1/2]

DWARFDebugInfoEntry* DWARFDebugInfoEntry::GetFirstChild ( )
inline

Definition at line 142 of file DWARFDebugInfoEntry.h.

References HasChildren().

◆ GetFirstChild() [2/2]

const DWARFDebugInfoEntry* DWARFDebugInfoEntry::GetFirstChild ( ) const
inline

◆ GetMangledName()

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

Definition at line 643 of file DWARFDebugInfoEntry.cpp.

Referenced by operator bool().

◆ GetName()

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

Definition at line 634 of file DWARFDebugInfoEntry.cpp.

Referenced by GetDWARFDeclContextStatic(), and operator bool().

◆ GetOffset()

dw_offset_t DWARFDebugInfoEntry::GetOffset ( ) const
inline

Definition at line 117 of file DWARFDebugInfoEntry.h.

References m_offset.

Referenced by CompareDIEOffset(), and GetRangesOrReportError().

◆ GetParent() [1/2]

DWARFDebugInfoEntry* DWARFDebugInfoEntry::GetParent ( )
inline

◆ GetParent() [2/2]

const DWARFDebugInfoEntry* DWARFDebugInfoEntry::GetParent ( ) const
inline

Definition at line 128 of file DWARFDebugInfoEntry.h.

References m_parent_idx.

◆ GetParentDeclContextDIE() [1/2]

DWARFDIE DWARFDebugInfoEntry::GetParentDeclContextDIE ( DWARFUnit cu) const

Definition at line 730 of file DWARFDebugInfoEntry.cpp.

Referenced by GetDWARFDeclContextStatic(), and GetFirstChild().

◆ GetParentDeclContextDIE() [2/2]

DWARFDIE DWARFDebugInfoEntry::GetParentDeclContextDIE ( DWARFUnit cu,
const DWARFAttributes attributes 
) const

◆ GetPubname()

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

Definition at line 666 of file DWARFDebugInfoEntry.cpp.

Referenced by operator bool().

◆ GetQualifiedName() [1/2]

const char * DWARFDebugInfoEntry::GetQualifiedName ( DWARFUnit cu,
std::string &  storage 
) const

Definition at line 779 of file DWARFDebugInfoEntry.cpp.

Referenced by operator bool().

◆ GetQualifiedName() [2/2]

const char * DWARFDebugInfoEntry::GetQualifiedName ( DWARFUnit cu,
const DWARFAttributes attributes,
std::string &  storage 
) const

◆ GetSibling() [1/2]

DWARFDebugInfoEntry* DWARFDebugInfoEntry::GetSibling ( )
inline

Definition at line 133 of file DWARFDebugInfoEntry.h.

References m_sibling_idx.

Referenced by BuildFunctionAddressRangeTable().

◆ GetSibling() [2/2]

const DWARFDebugInfoEntry* DWARFDebugInfoEntry::GetSibling ( ) const
inline

Definition at line 136 of file DWARFDebugInfoEntry.h.

References m_sibling_idx.

◆ HasChildren()

bool DWARFDebugInfoEntry::HasChildren ( ) const
inline

Definition at line 119 of file DWARFDebugInfoEntry.h.

References m_has_children.

Referenced by DWARFUnit::ExtractDIEsRWLocked(), and GetFirstChild().

◆ IsGlobalOrStaticScopeVariable()

bool DWARFDebugInfoEntry::IsGlobalOrStaticScopeVariable ( ) const

Definition at line 853 of file DWARFDebugInfoEntry.cpp.

References GetParent(), and Tag().

Referenced by SetParentIndex().

◆ IsNULL()

bool DWARFDebugInfoEntry::IsNULL ( ) const
inline

Definition at line 115 of file DWARFDebugInfoEntry.h.

References m_abbr_idx.

Referenced by DWARFUnit::ExtractDIEsRWLocked().

◆ operator bool()

DWARFDebugInfoEntry::operator bool ( ) const
inlineexplicit

◆ operator!=()

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

Definition at line 883 of file DWARFDebugInfoEntry.cpp.

Referenced by operator bool().

◆ operator==()

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

Definition at line 876 of file DWARFDebugInfoEntry.cpp.

References m_abbr_idx, m_has_children, m_offset, m_parent_idx, m_sibling_idx, and m_tag.

Referenced by operator bool().

◆ SetHasChildren()

void DWARFDebugInfoEntry::SetHasChildren ( bool  b)
inline

Definition at line 121 of file DWARFDebugInfoEntry.h.

References m_has_children.

Referenced by DWARFUnit::ExtractDIEsRWLocked().

◆ SetParentIndex()

void DWARFDebugInfoEntry::SetParentIndex ( uint32_t  idx)
inline

◆ SetSiblingIndex()

void DWARFDebugInfoEntry::SetSiblingIndex ( uint32_t  idx)
inline

Definition at line 155 of file DWARFDebugInfoEntry.h.

References m_sibling_idx.

◆ Tag()

dw_tag_t DWARFDebugInfoEntry::Tag ( ) const
inline

Member Data Documentation

◆ m_abbr_idx

uint16_t DWARFDebugInfoEntry::m_abbr_idx
protected

Definition at line 175 of file DWARFDebugInfoEntry.h.

Referenced by IsNULL(), and operator==().

◆ m_has_children

uint32_t DWARFDebugInfoEntry::m_has_children
protected

Definition at line 170 of file DWARFDebugInfoEntry.h.

Referenced by HasChildren(), operator==(), and SetHasChildren().

◆ m_offset

dw_offset_t DWARFDebugInfoEntry::m_offset
protected

Definition at line 167 of file DWARFDebugInfoEntry.h.

Referenced by GetOffset(), operator bool(), and operator==().

◆ m_parent_idx

uint32_t DWARFDebugInfoEntry::m_parent_idx
protected

Definition at line 168 of file DWARFDebugInfoEntry.h.

Referenced by GetParent(), operator==(), and SetParentIndex().

◆ m_sibling_idx

uint32_t DWARFDebugInfoEntry::m_sibling_idx
protected

Definition at line 170 of file DWARFDebugInfoEntry.h.

Referenced by GetSibling(), operator==(), and SetSiblingIndex().

◆ m_tag

dw_tag_t 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 178 of file DWARFDebugInfoEntry.h.

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


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