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 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) |
DWARFDebugInfoEntry * | GetParent () |
const DWARFDebugInfoEntry * | GetParent () const |
DWARFDebugInfoEntry * | GetSibling () |
const DWARFDebugInfoEntry * | GetSibling () const |
DWARFDebugInfoEntry * | GetFirstChild () |
const DWARFDebugInfoEntry * | GetFirstChild () 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. |
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.
typedef std::vector<DWARFDebugInfoEntry> lldb_private::plugin::dwarf::DWARFDebugInfoEntry::collection |
Definition at line 36 of file DWARFDebugInfoEntry.h.
typedef collection::const_iterator lldb_private::plugin::dwarf::DWARFDebugInfoEntry::const_iterator |
Definition at line 38 of file DWARFDebugInfoEntry.h.
typedef collection::iterator lldb_private::plugin::dwarf::DWARFDebugInfoEntry::iterator |
Definition at line 37 of file DWARFDebugInfoEntry.h.
Definition at line 54 of file DWARFDebugInfoEntry.h.
|
inline |
Definition at line 40 of file DWARFDebugInfoEntry.h.
References DW_INVALID_OFFSET, m_has_children, m_offset, m_parent_idx, and m_sibling_idx.
Referenced by BuildFunctionAddressRangeTable(), GetFirstChild(), GetFirstChild(), GetParent(), GetParent(), GetSibling(), GetSibling(), IsGlobalOrStaticScopeVariable(), operator!=(), and operator==().
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().
bool DWARFDebugInfoEntry::Extract | ( | const DWARFDataExtractor & | data, |
const DWARFUnit & | cu, | ||
lldb::offset_t * | offset_ptr ) |
Definition at line 43 of file DWARFDebugInfoEntry.cpp.
References GetAbbreviationDeclarationPtr(), lldb_private::ModuleChild::GetModule(), lldb_private::SymbolFileCommon::GetObjectFile(), lldb_private::plugin::dwarf::DWARFUnit::GetSymbolFileDWARF(), lldb_private::DataExtractor::GetULEB128(), m_abbr_idx, m_has_children, m_offset, m_parent_idx, m_sibling_idx, m_tag, and lldb_private::plugin::dwarf::DWARFFormValue::SkipValue().
Referenced by lldb_private::plugin::dwarf::DWARFUnit::ExtractDIEsRWLocked(), and lldb_private::plugin::dwarf::DWARFUnit::PeekDIEName().
const llvm::DWARFAbbreviationDeclaration * DWARFDebugInfoEntry::GetAbbreviationDeclarationPtr | ( | const DWARFUnit * | cu | ) | const |
Definition at line 645 of file DWARFDebugInfoEntry.cpp.
References lldb_private::plugin::dwarf::DWARFUnit::GetAbbreviations(), and m_abbr_idx.
Referenced by Extract(), 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_elaborating_dies = false ) const |
Definition at line 524 of file DWARFDebugInfoEntry.cpp.
References GetAttributeHighPC(), and GetAttributeValueAsAddress().
Referenced by GetAttributeAddressRanges().
llvm::Expected< llvm::DWARFAddressRangesVector > DWARFDebugInfoEntry::GetAttributeAddressRanges | ( | DWARFUnit * | cu, |
bool | check_hi_lo_pc, | ||
bool | check_elaborating_dies = false ) const |
Definition at line 540 of file DWARFDebugInfoEntry.cpp.
References GetAttributeAddressRange(), GetAttributeValue(), GetRanges(), and LLDB_INVALID_ADDRESS.
Referenced by lldb_private::plugin::dwarf::DWARFCompileUnit::BuildAddressRangeTable(), and BuildFunctionAddressRangeTable().
dw_addr_t DWARFDebugInfoEntry::GetAttributeHighPC | ( | const DWARFUnit * | cu, |
dw_addr_t | lo_pc, | ||
uint64_t | fail_value, | ||
bool | check_elaborating_dies = false ) const |
Definition at line 501 of file DWARFDebugInfoEntry.cpp.
References lldb_private::plugin::dwarf::DWARFFormValue::Address(), lldb_private::plugin::dwarf::DWARFFormValue::Form(), GetAttributeValue(), and lldb_private::plugin::dwarf::DWARFFormValue::Unsigned().
Referenced by GetAttributeAddressRange().
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.
[in] | cu | DWARFUnit that this entry belongs to. |
[in] | recurse | If 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). |
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().
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_elaborating_dies = false ) const |
Definition at line 389 of file DWARFDebugInfoEntry.cpp.
References lldb_private::plugin::dwarf::DWARFFormValue::ExtractValue(), GetAbbreviationDeclarationPtr(), GetAttributeValue(), lldb_private::plugin::dwarf::DWARFBaseDIE::GetCU(), lldb_private::plugin::dwarf::DWARFUnit::GetData(), lldb_private::plugin::dwarf::DWARFDIE::GetDIE(), GetFirstAttributeOffset(), lldb_private::plugin::dwarf::DWARFFormValue::Reference(), lldb_private::plugin::dwarf::DWARFFormValue::SetForm(), lldb_private::plugin::dwarf::DWARFFormValue::SetUnit(), lldb_private::plugin::dwarf::DWARFFormValue::SetValue(), and lldb_private::plugin::dwarf::DWARFFormValue::SkipValue().
Referenced by GetAttributeAddressRanges(), GetAttributeHighPC(), GetAttributeValue(), GetAttributeValueAsAddress(), GetAttributeValueAsOptionalUnsigned(), GetAttributeValueAsReference(), GetAttributeValueAsString(), GetAttributeValueAsUnsigned(), and lldb_private::plugin::dwarf::DWARFUnit::PeekDIEName().
uint64_t DWARFDebugInfoEntry::GetAttributeValueAsAddress | ( | const DWARFUnit * | cu, |
const dw_attr_t | attr, | ||
uint64_t | fail_value, | ||
bool | check_elaborating_dies = false ) const |
Definition at line 485 of file DWARFDebugInfoEntry.cpp.
References lldb_private::plugin::dwarf::DWARFFormValue::Address(), and GetAttributeValue().
Referenced by GetAttributeAddressRange().
std::optional< uint64_t > DWARFDebugInfoEntry::GetAttributeValueAsOptionalUnsigned | ( | const DWARFUnit * | cu, |
const dw_attr_t | attr, | ||
bool | check_elaborating_dies = false ) const |
Definition at line 463 of file DWARFDebugInfoEntry.cpp.
References GetAttributeValue(), and lldb_private::plugin::dwarf::DWARFFormValue::Unsigned().
Referenced by BuildFunctionAddressRangeTable(), and GetDWOId().
DWARFDIE DWARFDebugInfoEntry::GetAttributeValueAsReference | ( | const DWARFUnit * | cu, |
const dw_attr_t | attr, | ||
bool | check_elaborating_dies = false ) const |
Definition at line 476 of file DWARFDebugInfoEntry.cpp.
References GetAttributeValue(), and lldb_private::plugin::dwarf::DWARFFormValue::Reference().
const char * DWARFDebugInfoEntry::GetAttributeValueAsString | ( | const DWARFUnit * | cu, |
const dw_attr_t | attr, | ||
const char * | fail_value, | ||
bool | check_elaborating_dies = false ) const |
Definition at line 441 of file DWARFDebugInfoEntry.cpp.
References lldb_private::plugin::dwarf::DWARFFormValue::AsCString(), and GetAttributeValue().
Referenced by lldb_private::plugin::dwarf::DWARFUnit::ComputeAbsolutePath(), lldb_private::plugin::dwarf::DWARFUnit::ComputeCompDirAndGuessPathStyle(), GetDWOName(), lldb_private::plugin::dwarf::SymbolFileDWARF::GetDwoSymbolFileForCompileUnit(), GetMangledName(), GetName(), lldb_private::plugin::dwarf::DWARFDIE::GetName(), GetPubname(), lldb_private::plugin::dwarf::DWARFUnit::ParseProducerInfo(), and lldb_private::plugin::dwarf::DWARFUnit::PeekDIEName().
uint64_t DWARFDebugInfoEntry::GetAttributeValueAsUnsigned | ( | const DWARFUnit * | cu, |
const dw_attr_t | attr, | ||
uint64_t | fail_value, | ||
bool | check_elaborating_dies = false ) const |
Definition at line 453 of file DWARFDebugInfoEntry.cpp.
References GetAttributeValue(), and lldb_private::plugin::dwarf::DWARFFormValue::Unsigned().
Referenced by lldb_private::plugin::dwarf::DWARFUnit::GetDWARFLanguageType(), and lldb_private::plugin::dwarf::DWARFUnit::GetIsOptimized().
bool DWARFDebugInfoEntry::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 |
Definition at line 105 of file DWARFDebugInfoEntry.cpp.
References lldb_private::plugin::dwarf::DWARFFormValue::Address(), lldb_private::plugin::dwarf::DWARFFormValue::AsCString(), lldb_private::plugin::dwarf::DWARFFormValue::BlockData(), ExtractAttrAndFormValue(), lldb_private::plugin::dwarf::DWARFFormValue::ExtractValue(), lldb_private::plugin::dwarf::DWARFFormValue::Form(), GetAbbreviationDeclarationPtr(), lldb_private::plugin::dwarf::DWARFUnit::GetBaseAddress(), lldb_private::DataExtractor::GetByteSize(), lldb_private::plugin::dwarf::DWARFUnit::GetData(), lldb_private::DataExtractor::GetDataStart(), GetFirstAttributeOffset(), lldb_private::plugin::dwarf::DWARFUnit::GetLocationData(), GetRanges(), lldb_private::plugin::dwarf::DWARFUnit::GetSymbolFileDWARF(), LLDB_INVALID_ADDRESS, lldb_private::plugin::dwarf::DWARFUnit::ParseDWARFLocationList(), lldb_private::plugin::dwarf::DWARFFormValue::Reference(), lldb_private::DWARFExpressionList::SetFuncFileAddress(), lldb_private::plugin::dwarf::DWARFFormValue::Unsigned(), and lldb_private::DataExtractor::ValidOffset().
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().
|
inline |
Definition at line 167 of file DWARFDebugInfoEntry.h.
References DWARFDebugInfoEntry(), and HasChildren().
Referenced by BuildFunctionAddressRangeTable().
|
inline |
Definition at line 170 of file DWARFDebugInfoEntry.h.
References DWARFDebugInfoEntry(), and HasChildren().
const char * DWARFDebugInfoEntry::GetMangledName | ( | const DWARFUnit * | cu, |
bool | substitute_name_allowed = true ) const |
Definition at line 571 of file DWARFDebugInfoEntry.cpp.
References GetAttributeValueAsString().
const char * DWARFDebugInfoEntry::GetName | ( | const DWARFUnit * | cu | ) | const |
Definition at line 562 of file DWARFDebugInfoEntry.cpp.
References GetAttributeValueAsString().
|
inline |
Definition at line 142 of file DWARFDebugInfoEntry.h.
References m_offset.
Referenced by BuildFunctionAddressRangeTable(), CompareDIEOffset(), lldb_private::plugin::dwarf::SymbolFileDWARF::GetDwoSymbolFileForCompileUnit(), and GetFirstAttributeOffset().
|
inline |
Definition at line 150 of file DWARFDebugInfoEntry.h.
References DWARFDebugInfoEntry(), and m_parent_idx.
Referenced by lldb_private::plugin::dwarf::UniqueDWARFASTTypeList::Find(), lldb_private::plugin::dwarf::SymbolFileDWARF::GetTypeForDIE(), and IsGlobalOrStaticScopeVariable().
|
inline |
Definition at line 153 of file DWARFDebugInfoEntry.h.
References DWARFDebugInfoEntry(), and m_parent_idx.
const char * DWARFDebugInfoEntry::GetPubname | ( | const DWARFUnit * | cu | ) | const |
Definition at line 594 of file DWARFDebugInfoEntry.cpp.
References GetAttributeValueAsString().
|
inline |
Definition at line 158 of file DWARFDebugInfoEntry.h.
References DWARFDebugInfoEntry(), and m_sibling_idx.
Referenced by BuildFunctionAddressRangeTable().
|
inline |
Definition at line 161 of file DWARFDebugInfoEntry.h.
References DWARFDebugInfoEntry(), and m_sibling_idx.
|
inline |
Definition at line 144 of file DWARFDebugInfoEntry.h.
References m_has_children.
Referenced by lldb_private::plugin::dwarf::DWARFUnit::ExtractDIEsRWLocked(), GetFirstChild(), and GetFirstChild().
bool DWARFDebugInfoEntry::IsGlobalOrStaticScopeVariable | ( | ) | const |
Definition at line 657 of file DWARFDebugInfoEntry.cpp.
References DWARFDebugInfoEntry(), GetParent(), and Tag().
|
inline |
Definition at line 140 of file DWARFDebugInfoEntry.h.
References m_abbr_idx.
Referenced by lldb_private::plugin::dwarf::DWARFUnit::ExtractDIEsRWLocked().
|
inlineexplicit |
Definition at line 44 of file DWARFDebugInfoEntry.h.
References DW_INVALID_OFFSET, and m_offset.
bool DWARFDebugInfoEntry::operator!= | ( | const DWARFDebugInfoEntry & | rhs | ) | const |
Definition at line 687 of file DWARFDebugInfoEntry.cpp.
References DWARFDebugInfoEntry().
bool DWARFDebugInfoEntry::operator== | ( | const DWARFDebugInfoEntry & | rhs | ) | const |
Definition at line 680 of file DWARFDebugInfoEntry.cpp.
References DWARFDebugInfoEntry(), m_abbr_idx, m_has_children, m_offset, m_parent_idx, m_sibling_idx, and m_tag.
|
inline |
Definition at line 146 of file DWARFDebugInfoEntry.h.
References m_has_children.
|
inline |
Definition at line 175 of file DWARFDebugInfoEntry.h.
References m_parent_idx.
Referenced by lldb_private::plugin::dwarf::DWARFUnit::ExtractDIEsRWLocked().
|
inline |
Definition at line 174 of file DWARFDebugInfoEntry.h.
References m_sibling_idx.
|
inline |
Definition at line 138 of file DWARFDebugInfoEntry.h.
References m_tag.
Referenced by lldb_private::plugin::dwarf::SymbolFileDWARF::GetTypeForDIE(), and IsGlobalOrStaticScopeVariable().
|
protected |
Definition at line 193 of file DWARFDebugInfoEntry.h.
Referenced by Extract(), GetAbbreviationDeclarationPtr(), GetFirstAttributeOffset(), IsNULL(), and operator==().
|
protected |
Definition at line 192 of file DWARFDebugInfoEntry.h.
Referenced by DWARFDebugInfoEntry(), Extract(), HasChildren(), operator==(), and SetHasChildren().
|
protected |
Definition at line 184 of file DWARFDebugInfoEntry.h.
Referenced by DWARFDebugInfoEntry(), Extract(), GetOffset(), operator bool(), and operator==().
|
protected |
Definition at line 187 of file DWARFDebugInfoEntry.h.
Referenced by DWARFDebugInfoEntry(), Extract(), GetParent(), GetParent(), operator==(), and SetParentIndex().
|
protected |
Definition at line 192 of file DWARFDebugInfoEntry.h.
Referenced by DWARFDebugInfoEntry(), Extract(), GetSibling(), 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 196 of file DWARFDebugInfoEntry.h.
Referenced by BuildFunctionAddressRangeTable(), Extract(), operator==(), and Tag().