LLDB mainline
|
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< DWARFDebugInfoEntry > | collection |
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 lldb_private::DWARFDataExtractor &data, const DWARFUnit *cu, lldb::offset_t *offset_ptr) |
size_t | GetAttributes (DWARFUnit *cu, DWARFAttributes &attrs, Recurse recurse=Recurse::yes) 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 |
std::optional< uint64_t > | GetAttributeValueAsOptionalUnsigned (const DWARFUnit *cu, const dw_attr_t attr, 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 |
bool | GetDIENamesAndRanges (DWARFUnit *cu, const char *&name, const char *&mangled, DWARFRangeList &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, lldb_private::DWARFExpressionList *frame_base=nullptr) const |
const 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) |
DWARFDebugInfoEntry * | GetParent () |
const DWARFDebugInfoEntry * | GetParent () const |
DWARFDebugInfoEntry * | GetSibling () |
const DWARFDebugInfoEntry * | GetSibling () const |
DWARFDebugInfoEntry * | GetFirstChild () |
const DWARFDebugInfoEntry * | GetFirstChild () 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: 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. | |
Private Member Functions | |
size_t | GetAttributes (DWARFUnit *cu, DWARFAttributes &attrs, Recurse recurse, uint32_t curr_depth) const |
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 32 of file DWARFDebugInfoEntry.h.
typedef std::vector<DWARFDebugInfoEntry> DWARFDebugInfoEntry::collection |
Definition at line 34 of file DWARFDebugInfoEntry.h.
typedef collection::const_iterator DWARFDebugInfoEntry::const_iterator |
Definition at line 36 of file DWARFDebugInfoEntry.h.
typedef collection::iterator DWARFDebugInfoEntry::iterator |
Definition at line 35 of file DWARFDebugInfoEntry.h.
Definition at line 52 of file DWARFDebugInfoEntry.h.
|
inline |
Definition at line 38 of file DWARFDebugInfoEntry.h.
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 712 of file DWARFDebugInfoEntry.cpp.
References DWARFDebugAranges::AppendRange(), BuildFunctionAddressRangeTable(), GetAttributeAddressRanges(), GetFirstChild(), GetOffset(), GetSibling(), and m_tag.
Referenced by BuildFunctionAddressRangeTable(), and DWARFUnit::GetFunctionAranges().
bool DWARFDebugInfoEntry::Extract | ( | const lldb_private::DWARFDataExtractor & | data, |
const DWARFUnit * | cu, | ||
lldb::offset_t * | offset_ptr | ||
) |
Definition at line 41 of file DWARFDebugInfoEntry.cpp.
References GetAbbreviationDeclarationPtr(), DWARFUnit::GetAddressByteSize(), lldb_private::DataExtractor::GetCStr(), DWARFFormValue::GetFixedSize(), lldb_private::ModuleChild::GetModule(), lldb_private::SymbolFileCommon::GetObjectFile(), DWARFUnit::GetSymbolFileDWARF(), lldb_private::DataExtractor::GetU16_unchecked(), lldb_private::DataExtractor::GetU32(), lldb_private::DataExtractor::GetU32_unchecked(), lldb_private::DataExtractor::GetU8_unchecked(), lldb_private::DataExtractor::GetULEB128(), DWARFUnit::GetVersion(), lldbassert, m_abbr_idx, m_has_children, m_offset, m_parent_idx, m_sibling_idx, m_tag, lldb_private::DataExtractor::Skip_LEB128(), and UINT32_MAX.
Referenced by DWARFUnit::ExtractDIEsRWLocked(), and DWARFUnit::ExtractUnitDIENoDwoIfNeeded().
const DWARFAbbreviationDeclaration * DWARFDebugInfoEntry::GetAbbreviationDeclarationPtr | ( | const DWARFUnit * | cu | ) | const |
Definition at line 812 of file DWARFDebugInfoEntry.cpp.
References DWARFAbbreviationDeclarationSet::GetAbbreviationDeclaration(), DWARFUnit::GetAbbreviations(), and m_abbr_idx.
Referenced by Extract(), GetAttributes(), GetAttributeValue(), and GetDIENamesAndRanges().
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 620 of file DWARFDebugInfoEntry.cpp.
References GetAttributeHighPC(), and GetAttributeValueAsAddress().
Referenced by GetAttributeAddressRanges().
size_t DWARFDebugInfoEntry::GetAttributeAddressRanges | ( | DWARFUnit * | cu, |
DWARFRangeList & | ranges, | ||
bool | check_hi_lo_pc, | ||
bool | check_specification_or_abstract_origin = false |
||
) | const |
Definition at line 636 of file DWARFDebugInfoEntry.cpp.
References lldb_private::RangeVector< B, S, N >::Append(), lldb_private::RangeVector< B, S, N >::Clear(), GetAttributeAddressRange(), GetAttributeValue(), GetRangesOrReportError(), lldb_private::RangeVector< B, S, N >::GetSize(), and LLDB_INVALID_ADDRESS.
Referenced by DWARFCompileUnit::BuildAddressRangeTable(), BuildFunctionAddressRangeTable(), and DWARFDIE::LookupDeepestBlock().
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 |
Definition at line 597 of file DWARFDebugInfoEntry.cpp.
References DWARFFormValue::Address(), DWARFFormValue::Form(), GetAttributeValue(), and DWARFFormValue::Unsigned().
Referenced by GetAttributeAddressRange().
|
private |
Definition at line 413 of file DWARFDebugInfoEntry.cpp.
References DWARFAttributes::Append(), DWARFAttributes::Clear(), DWARFFormValue::ExtractValue(), DWARFFormValue::Form(), GetAbbreviationDeclarationPtr(), DWARFBaseDIE::GetAttributes(), DWARFBaseDIE::GetCU(), DWARFUnit::GetData(), DWARFDIE::GetDIE(), GetFirstAttributeOffset(), DWARFFormValue::GetFixedSize(), DWARFFormValue::Reference(), DWARFAttributes::Size(), and DWARFFormValue::SkipValue().
|
inline |
Definition at line 53 of file DWARFDebugInfoEntry.h.
References GetAttributes().
Referenced by DWARFUnit::AddUnitDIE(), DWARFBaseDIE::GetAttributes(), GetAttributes(), and GetParentDeclContextDIE().
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 |
Definition at line 476 of file DWARFDebugInfoEntry.cpp.
References DW_INVALID_INDEX, DWARFFormValue::ExtractValue(), GetAbbreviationDeclarationPtr(), GetAttributeValue(), DWARFBaseDIE::GetCU(), DWARFUnit::GetData(), DWARFDIE::GetDIE(), GetFirstAttributeOffset(), DWARFFormValue::Reference(), DWARFFormValue::SetForm(), DWARFFormValue::SetUnit(), and DWARFFormValue::SkipValue().
Referenced by GetAttributeAddressRanges(), GetAttributeHighPC(), GetAttributeValue(), GetAttributeValueAsAddress(), GetAttributeValueAsOptionalUnsigned(), GetAttributeValueAsReference(), DWARFDIE::GetAttributeValueAsReferenceDIE(), GetAttributeValueAsString(), and GetAttributeValueAsUnsigned().
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 581 of file DWARFDebugInfoEntry.cpp.
References DWARFFormValue::Address(), and GetAttributeValue().
Referenced by GetAttributeAddressRange(), and DWARFBaseDIE::GetAttributeValueAsAddress().
std::optional< uint64_t > DWARFDebugInfoEntry::GetAttributeValueAsOptionalUnsigned | ( | const DWARFUnit * | cu, |
const dw_attr_t | attr, | ||
bool | check_specification_or_abstract_origin = false |
||
) | const |
Definition at line 557 of file DWARFDebugInfoEntry.cpp.
References GetAttributeValue(), and DWARFFormValue::Unsigned().
Referenced by DWARFBaseDIE::GetAttributeValueAsOptionalUnsigned(), and GetDWOId().
DWARFDIE DWARFDebugInfoEntry::GetAttributeValueAsReference | ( | const DWARFUnit * | cu, |
const dw_attr_t | attr, | ||
bool | check_specification_or_abstract_origin = false |
||
) | const |
Definition at line 571 of file DWARFDebugInfoEntry.cpp.
References GetAttributeValue(), and DWARFFormValue::Reference().
Referenced by DWARFDIE::GetReferencedDIE().
const char * DWARFDebugInfoEntry::GetAttributeValueAsString | ( | const DWARFUnit * | cu, |
const dw_attr_t | attr, | ||
const char * | fail_value, | ||
bool | check_specification_or_abstract_origin = false |
||
) | const |
Definition at line 533 of file DWARFDebugInfoEntry.cpp.
References DWARFFormValue::AsCString(), and GetAttributeValue().
Referenced by DWARFUnit::ComputeAbsolutePath(), DWARFUnit::ComputeCompDirAndGuessPathStyle(), DWARFBaseDIE::GetAttributeValueAsString(), GetDWOName(), SymbolFileDWARF::GetDwoSymbolFileForCompileUnit(), GetMangledName(), GetName(), DWARFDIE::GetName(), GetPubname(), and DWARFUnit::ParseProducerInfo().
uint64_t DWARFDebugInfoEntry::GetAttributeValueAsUnsigned | ( | const DWARFUnit * | cu, |
const dw_attr_t | attr, | ||
uint64_t | fail_value, | ||
bool | check_specification_or_abstract_origin = false |
||
) | const |
Definition at line 546 of file DWARFDebugInfoEntry.cpp.
References GetAttributeValue(), and DWARFFormValue::Unsigned().
Referenced by DWARFBaseDIE::GetAttributeValueAsUnsigned(), DWARFUnit::GetDWARFLanguageType(), and DWARFUnit::GetIsOptimized().
bool DWARFDebugInfoEntry::GetDIENamesAndRanges | ( | DWARFUnit * | cu, |
const char *& | name, | ||
const char *& | mangled, | ||
DWARFRangeList & | 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, | ||
lldb_private::DWARFExpressionList * | frame_base = nullptr |
||
) | const |
Definition at line 235 of file DWARFDebugInfoEntry.cpp.
References DWARFFormValue::Address(), lldb_private::RangeVector< B, S, N >::Append(), DWARFFormValue::AsCString(), DWARFFormValue::BlockData(), DWARFFormValue::ExtractValue(), DWARFFormValue::Form(), GetAbbreviationDeclarationPtr(), DWARFUnit::GetBaseAddress(), lldb_private::DataExtractor::GetByteSize(), DWARFUnit::GetData(), lldb_private::DataExtractor::GetDataStart(), GetFirstAttributeOffset(), DWARFUnit::GetLocationData(), lldb_private::RangeVector< B, S, N >::GetMinRangeBase(), GetRangesOrReportError(), DWARFUnit::GetSymbolFileDWARF(), lldb_private::RangeVector< B, S, N >::IsEmpty(), LLDB_INVALID_ADDRESS, lldb_private::DWARFExpression::ParseDWARFLocationList(), DWARFFormValue::Reference(), lldb_private::DWARFExpressionList::SetFuncFileAddress(), DWARFFormValue::Unsigned(), and lldb_private::DataExtractor::ValidOffset().
Referenced by DWARFDIE::GetDIENamesAndRanges().
DWARFDeclContext DWARFDebugInfoEntry::GetDWARFDeclContext | ( | DWARFUnit * | cu | ) | const |
Definition at line 753 of file DWARFDebugInfoEntry.cpp.
References GetDWARFDeclContextStatic().
|
staticprotected |
Definition at line 734 of file DWARFDebugInfoEntry.cpp.
References DWARFDeclContext::AppendDeclContext(), DWARFBaseDIE::GetCU(), DWARFDIE::GetDIE(), GetName(), GetParentDeclContextDIE(), DWARFBaseDIE::Tag(), and Tag().
Referenced by GetDWARFDeclContext().
lldb::offset_t DWARFDebugInfoEntry::GetFirstAttributeOffset | ( | ) | const |
Definition at line 807 of file DWARFDebugInfoEntry.cpp.
References GetOffset(), and m_abbr_idx.
Referenced by GetAttributes(), GetAttributeValue(), and GetDIENamesAndRanges().
|
inline |
Definition at line 146 of file DWARFDebugInfoEntry.h.
References HasChildren().
Referenced by BuildFunctionAddressRangeTable(), and DWARFDIE::GetFirstChild().
|
inline |
Definition at line 149 of file DWARFDebugInfoEntry.h.
References HasChildren().
const char * DWARFDebugInfoEntry::GetMangledName | ( | const DWARFUnit * | cu, |
bool | substitute_name_allowed = true |
||
) | const |
Definition at line 669 of file DWARFDebugInfoEntry.cpp.
References GetAttributeValueAsString().
Referenced by DWARFDIE::GetMangledName().
const char * DWARFDebugInfoEntry::GetName | ( | const DWARFUnit * | cu | ) | const |
Definition at line 660 of file DWARFDebugInfoEntry.cpp.
References GetAttributeValueAsString().
Referenced by GetDWARFDeclContextStatic(), and DWARFBaseDIE::GetName().
|
inline |
Definition at line 121 of file DWARFDebugInfoEntry.h.
References m_offset.
Referenced by BuildFunctionAddressRangeTable(), CompareDIEOffset(), DWARFUnit::ExtractUnitDIEIfNeeded(), DWARFBaseDIE::GetDIERef(), SymbolFileDWARF::GetDwoSymbolFileForCompileUnit(), GetFirstAttributeOffset(), and GetRangesOrReportError().
|
inline |
Definition at line 129 of file DWARFDebugInfoEntry.h.
References m_parent_idx.
Referenced by UniqueDWARFASTTypeList::Find(), DWARFDIE::GetParent(), SymbolFileDWARF::GetTypeForDIE(), and IsGlobalOrStaticScopeVariable().
|
inline |
Definition at line 132 of file DWARFDebugInfoEntry.h.
References m_parent_idx.
Definition at line 758 of file DWARFDebugInfoEntry.cpp.
References GetAttributes(), and GetParentDeclContextDIE().
Referenced by GetDWARFDeclContextStatic(), DWARFDIE::GetParentDeclContextDIE(), and GetParentDeclContextDIE().
DWARFDIE DWARFDebugInfoEntry::GetParentDeclContextDIE | ( | DWARFUnit * | cu, |
const DWARFAttributes & | attributes | ||
) | const |
Definition at line 765 of file DWARFDebugInfoEntry.cpp.
References DWARFAttributes::FormValueAsReference(), DWARFDIE::GetDIE(), DWARFDIE::GetParent(), DWARFDIE::GetParentDeclContextDIE(), and DWARFBaseDIE::Tag().
const char * DWARFDebugInfoEntry::GetPubname | ( | const DWARFUnit * | cu | ) | const |
Definition at line 692 of file DWARFDebugInfoEntry.cpp.
References GetAttributeValueAsString().
Referenced by DWARFDIE::GetPubname().
|
inline |
Definition at line 137 of file DWARFDebugInfoEntry.h.
References m_sibling_idx.
Referenced by BuildFunctionAddressRangeTable(), and DWARFDIE::GetSibling().
|
inline |
Definition at line 140 of file DWARFDebugInfoEntry.h.
References m_sibling_idx.
|
inline |
Definition at line 123 of file DWARFDebugInfoEntry.h.
References m_has_children.
Referenced by DWARFUnit::ExtractDIEsRWLocked(), GetFirstChild(), and DWARFBaseDIE::HasChildren().
bool DWARFDebugInfoEntry::IsGlobalOrStaticScopeVariable | ( | ) | const |
Definition at line 821 of file DWARFDebugInfoEntry.cpp.
References GetParent(), and Tag().
|
inline |
Definition at line 119 of file DWARFDebugInfoEntry.h.
References m_abbr_idx.
Referenced by DWARFUnit::ExtractDIEsRWLocked().
|
inlineexplicit |
Definition at line 42 of file DWARFDebugInfoEntry.h.
References DW_INVALID_OFFSET, and m_offset.
bool DWARFDebugInfoEntry::operator!= | ( | const DWARFDebugInfoEntry & | rhs | ) | const |
Definition at line 851 of file DWARFDebugInfoEntry.cpp.
bool DWARFDebugInfoEntry::operator== | ( | const DWARFDebugInfoEntry & | rhs | ) | const |
Definition at line 844 of file DWARFDebugInfoEntry.cpp.
References m_abbr_idx, m_has_children, m_offset, m_parent_idx, m_sibling_idx, and m_tag.
|
inline |
Definition at line 125 of file DWARFDebugInfoEntry.h.
References m_has_children.
Referenced by DWARFUnit::ExtractDIEsRWLocked().
|
inline |
Definition at line 160 of file DWARFDebugInfoEntry.h.
References m_parent_idx.
Referenced by DWARFUnit::ExtractDIEsRWLocked().
|
inline |
Definition at line 159 of file DWARFDebugInfoEntry.h.
References m_sibling_idx.
|
inline |
Definition at line 117 of file DWARFDebugInfoEntry.h.
References m_tag.
Referenced by GetDWARFDeclContextStatic(), SymbolFileDWARF::GetTypeForDIE(), IsGlobalOrStaticScopeVariable(), and DWARFBaseDIE::Tag().
|
protected |
Definition at line 181 of file DWARFDebugInfoEntry.h.
Referenced by Extract(), GetAbbreviationDeclarationPtr(), GetFirstAttributeOffset(), IsNULL(), and operator==().
|
protected |
Definition at line 180 of file DWARFDebugInfoEntry.h.
Referenced by Extract(), HasChildren(), operator==(), and SetHasChildren().
|
protected |
Definition at line 172 of file DWARFDebugInfoEntry.h.
Referenced by Extract(), GetOffset(), operator bool(), and operator==().
|
protected |
Definition at line 175 of file DWARFDebugInfoEntry.h.
Referenced by Extract(), GetParent(), operator==(), and SetParentIndex().
|
protected |
Definition at line 180 of file DWARFDebugInfoEntry.h.
Referenced by Extract(), GetSibling(), operator==(), and SetSiblingIndex().
|
protected |
A copy of the DW_TAG value so we don't have to go through the compile unit abbrev table.
Definition at line 184 of file DWARFDebugInfoEntry.h.
Referenced by BuildFunctionAddressRangeTable(), Extract(), operator==(), and Tag().