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 (DWARFUnit *cu, 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_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. | |
Private Member Functions | |
void | 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 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.
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 572 of file DWARFDebugInfoEntry.cpp.
References lldb_private::plugin::dwarf::DWARFDebugAranges::AppendRange(), BuildFunctionAddressRangeTable(), lldb_private::DebugInfo, GetAttributeAddressRanges(), 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(), lldb_private::plugin::dwarf::DWARFUnit::ExtractUnitDIENoDwoIfNeeded(), and lldb_private::plugin::dwarf::DWARFUnit::PeekDIEName().
const llvm::DWARFAbbreviationDeclaration * DWARFDebugInfoEntry::GetAbbreviationDeclarationPtr | ( | const DWARFUnit * | cu | ) | const |
Definition at line 599 of file DWARFDebugInfoEntry.cpp.
References lldb_private::plugin::dwarf::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_elaborating_dies = false |
||
) | const |
Definition at line 482 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 498 of file DWARFDebugInfoEntry.cpp.
References GetAttributeAddressRange(), GetAttributeValue(), GetRanges(), and LLDB_INVALID_ADDRESS.
Referenced by lldb_private::plugin::dwarf::DWARFCompileUnit::BuildAddressRangeTable(), BuildFunctionAddressRangeTable(), and lldb_private::plugin::dwarf::DWARFDIE::LookupDeepestBlock().
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 459 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().
|
private |
Definition at line 288 of file DWARFDebugInfoEntry.cpp.
References lldb_private::plugin::dwarf::DWARFAttributes::Append(), lldb_private::plugin::dwarf::DWARFAttributes::Clear(), ExtractAttrAndFormValue(), lldb_private::plugin::dwarf::DWARFFormValue::ExtractValue(), lldb_private::plugin::dwarf::DWARFFormValue::Form(), GetAbbreviationDeclarationPtr(), lldb_private::plugin::dwarf::DWARFBaseDIE::GetAttributes(), lldb_private::plugin::dwarf::DWARFBaseDIE::GetCU(), lldb_private::plugin::dwarf::DWARFUnit::GetData(), lldb_private::plugin::dwarf::DWARFDIE::GetDIE(), GetFirstAttributeOffset(), lldb_private::plugin::dwarf::DWARFFormValue::GetFixedSize(), lldb_private::plugin::dwarf::DWARFFormValue::Reference(), and lldb_private::plugin::dwarf::DWARFFormValue::SkipValue().
|
inline |
Definition at line 55 of file DWARFDebugInfoEntry.h.
References GetAttributes().
Referenced by lldb_private::plugin::dwarf::DWARFUnit::AddUnitDIE(), GetAttributes(), and lldb_private::plugin::dwarf::DWARFBaseDIE::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 350 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(), and lldb_private::plugin::dwarf::DWARFFormValue::SkipValue().
Referenced by lldb_private::plugin::dwarf::DWARFDIE::find(), GetAttributeAddressRanges(), GetAttributeHighPC(), GetAttributeValue(), GetAttributeValueAsAddress(), GetAttributeValueAsOptionalUnsigned(), GetAttributeValueAsReference(), lldb_private::plugin::dwarf::DWARFDIE::GetAttributeValueAsReferenceDIE(), 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 443 of file DWARFDebugInfoEntry.cpp.
References lldb_private::plugin::dwarf::DWARFFormValue::Address(), and GetAttributeValue().
Referenced by GetAttributeAddressRange(), and lldb_private::plugin::dwarf::DWARFBaseDIE::GetAttributeValueAsAddress().
std::optional< uint64_t > DWARFDebugInfoEntry::GetAttributeValueAsOptionalUnsigned | ( | const DWARFUnit * | cu, |
const dw_attr_t | attr, | ||
bool | check_elaborating_dies = false |
||
) | const |
Definition at line 421 of file DWARFDebugInfoEntry.cpp.
References GetAttributeValue(), and lldb_private::plugin::dwarf::DWARFFormValue::Unsigned().
Referenced by lldb_private::plugin::dwarf::DWARFBaseDIE::GetAttributeValueAsOptionalUnsigned(), and GetDWOId().
DWARFDIE DWARFDebugInfoEntry::GetAttributeValueAsReference | ( | const DWARFUnit * | cu, |
const dw_attr_t | attr, | ||
bool | check_elaborating_dies = false |
||
) | const |
Definition at line 434 of file DWARFDebugInfoEntry.cpp.
References GetAttributeValue(), and lldb_private::plugin::dwarf::DWARFFormValue::Reference().
Referenced by lldb_private::plugin::dwarf::DWARFDIE::GetReferencedDIE().
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 399 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(), lldb_private::plugin::dwarf::DWARFBaseDIE::GetAttributeValueAsString(), 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 411 of file DWARFDebugInfoEntry.cpp.
References GetAttributeValue(), and lldb_private::plugin::dwarf::DWARFFormValue::Unsigned().
Referenced by lldb_private::plugin::dwarf::DWARFBaseDIE::GetAttributeValueAsUnsigned(), 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(), GetOffset(), GetRanges(), lldb_private::plugin::dwarf::DWARFUnit::GetSymbolFileDWARF(), LLDB_INVALID_ADDRESS, lldb_private::DWARFExpression::ParseDWARFLocationList(), lldb_private::plugin::dwarf::DWARFFormValue::Reference(), lldb_private::DWARFExpressionList::SetFuncFileAddress(), lldb_private::plugin::dwarf::DWARFFormValue::Unsigned(), and lldb_private::DataExtractor::ValidOffset().
Referenced by lldb_private::plugin::dwarf::DWARFDIE::GetDIENamesAndRanges().
lldb::offset_t DWARFDebugInfoEntry::GetFirstAttributeOffset | ( | ) | const |
Definition at line 594 of file DWARFDebugInfoEntry.cpp.
References GetOffset(), and m_abbr_idx.
Referenced by GetAttributes(), GetAttributeValue(), and GetDIENamesAndRanges().
|
inline |
Definition at line 151 of file DWARFDebugInfoEntry.h.
References HasChildren().
Referenced by BuildFunctionAddressRangeTable(), and lldb_private::plugin::dwarf::DWARFDIE::GetFirstChild().
|
inline |
Definition at line 154 of file DWARFDebugInfoEntry.h.
References HasChildren().
const char * DWARFDebugInfoEntry::GetMangledName | ( | const DWARFUnit * | cu, |
bool | substitute_name_allowed = true |
||
) | const |
Definition at line 529 of file DWARFDebugInfoEntry.cpp.
References GetAttributeValueAsString().
Referenced by lldb_private::plugin::dwarf::DWARFDIE::GetMangledName().
const char * DWARFDebugInfoEntry::GetName | ( | const DWARFUnit * | cu | ) | const |
Definition at line 520 of file DWARFDebugInfoEntry.cpp.
References GetAttributeValueAsString().
Referenced by lldb_private::plugin::dwarf::DWARFBaseDIE::GetName().
|
inline |
Definition at line 126 of file DWARFDebugInfoEntry.h.
References m_offset.
Referenced by BuildFunctionAddressRangeTable(), CompareDIEOffset(), lldb_private::plugin::dwarf::DWARFUnit::ExtractUnitDIEIfNeeded(), GetDIENamesAndRanges(), lldb_private::plugin::dwarf::DWARFBaseDIE::GetDIERef(), lldb_private::plugin::dwarf::SymbolFileDWARF::GetDwoSymbolFileForCompileUnit(), GetFirstAttributeOffset(), and lldb_private::plugin::dwarf::DWARFBaseDIE::GetOffset().
|
inline |
Definition at line 134 of file DWARFDebugInfoEntry.h.
References m_parent_idx.
Referenced by lldb_private::plugin::dwarf::UniqueDWARFASTTypeList::Find(), lldb_private::plugin::dwarf::DWARFDIE::GetParent(), lldb_private::plugin::dwarf::SymbolFileDWARF::GetTypeForDIE(), and IsGlobalOrStaticScopeVariable().
|
inline |
Definition at line 137 of file DWARFDebugInfoEntry.h.
References m_parent_idx.
const char * DWARFDebugInfoEntry::GetPubname | ( | const DWARFUnit * | cu | ) | const |
Definition at line 552 of file DWARFDebugInfoEntry.cpp.
References GetAttributeValueAsString().
Referenced by lldb_private::plugin::dwarf::DWARFDIE::GetPubname().
|
inline |
Definition at line 142 of file DWARFDebugInfoEntry.h.
References m_sibling_idx.
Referenced by BuildFunctionAddressRangeTable(), and lldb_private::plugin::dwarf::DWARFDIE::GetSibling().
|
inline |
Definition at line 145 of file DWARFDebugInfoEntry.h.
References m_sibling_idx.
|
inline |
Definition at line 128 of file DWARFDebugInfoEntry.h.
References m_has_children.
Referenced by lldb_private::plugin::dwarf::DWARFUnit::ExtractDIEsRWLocked(), GetFirstChild(), and lldb_private::plugin::dwarf::DWARFBaseDIE::HasChildren().
bool DWARFDebugInfoEntry::IsGlobalOrStaticScopeVariable | ( | ) | const |
Definition at line 611 of file DWARFDebugInfoEntry.cpp.
References GetParent(), and Tag().
|
inline |
Definition at line 124 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 641 of file DWARFDebugInfoEntry.cpp.
bool DWARFDebugInfoEntry::operator== | ( | const DWARFDebugInfoEntry & | rhs | ) | const |
Definition at line 634 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 130 of file DWARFDebugInfoEntry.h.
References m_has_children.
Referenced by lldb_private::plugin::dwarf::DWARFUnit::ExtractDIEsRWLocked().
|
inline |
Definition at line 159 of file DWARFDebugInfoEntry.h.
References m_parent_idx.
Referenced by lldb_private::plugin::dwarf::DWARFUnit::ExtractDIEsRWLocked().
|
inline |
Definition at line 158 of file DWARFDebugInfoEntry.h.
References m_sibling_idx.
|
inline |
Definition at line 122 of file DWARFDebugInfoEntry.h.
References m_tag.
Referenced by lldb_private::plugin::dwarf::SymbolFileDWARF::GetTypeForDIE(), IsGlobalOrStaticScopeVariable(), and lldb_private::plugin::dwarf::DWARFBaseDIE::Tag().
|
protected |
Definition at line 177 of file DWARFDebugInfoEntry.h.
Referenced by Extract(), GetAbbreviationDeclarationPtr(), GetFirstAttributeOffset(), IsNULL(), and operator==().
|
protected |
Definition at line 176 of file DWARFDebugInfoEntry.h.
Referenced by Extract(), HasChildren(), operator==(), and SetHasChildren().
|
protected |
Definition at line 168 of file DWARFDebugInfoEntry.h.
Referenced by Extract(), GetOffset(), operator bool(), and operator==().
|
protected |
Definition at line 171 of file DWARFDebugInfoEntry.h.
Referenced by Extract(), GetParent(), operator==(), and SetParentIndex().
|
protected |
Definition at line 176 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 180 of file DWARFDebugInfoEntry.h.
Referenced by BuildFunctionAddressRangeTable(), Extract(), operator==(), and Tag().