LLDB mainline
|
#include <DWARFUnit.h>
Classes | |
class | ScopedExtractDIEs |
Public Member Functions | |
virtual | ~DWARFUnit () |
bool | IsDWOUnit () |
std::optional< uint64_t > | GetDWOId () |
void | ExtractUnitDIEIfNeeded () |
void | ExtractUnitDIENoDwoIfNeeded () |
void | ExtractDIEsIfNeeded () |
ScopedExtractDIEs | ExtractDIEsScoped () |
bool | Verify (lldb_private::Stream *s) const |
virtual void | Dump (lldb_private::Stream *s) const =0 |
const lldb_private::DWARFDataExtractor & | GetData () const |
Get the data that contains the DIE information for this unit. | |
uint32_t | GetHeaderByteSize () const |
Get the size in bytes of the unit header. | |
dw_offset_t | GetOffset () const |
size_t | GetLengthByteSize () const |
Get the size in bytes of the length field in the header. | |
bool | ContainsDIEOffset (dw_offset_t die_offset) const |
dw_offset_t | GetFirstDIEOffset () const |
dw_offset_t | GetNextUnitOffset () const |
size_t | GetDebugInfoSize () const |
uint32_t | GetLength () const |
uint16_t | GetVersion () const |
const DWARFAbbreviationDeclarationSet * | GetAbbreviations () const |
dw_offset_t | GetAbbrevOffset () const |
uint8_t | GetAddressByteSize () const |
dw_addr_t | GetAddrBase () const |
dw_addr_t | GetBaseAddress () const |
dw_offset_t | GetLineTableOffset () |
dw_addr_t | GetRangesBase () const |
dw_addr_t | GetStrOffsetsBase () const |
void | SetAddrBase (dw_addr_t addr_base) |
void | SetLoclistsBase (dw_addr_t loclists_base) |
void | SetRangesBase (dw_addr_t ranges_base) |
void | SetStrOffsetsBase (dw_offset_t str_offsets_base) |
virtual void | BuildAddressRangeTable (DWARFDebugAranges *debug_aranges)=0 |
dw_addr_t | ReadAddressFromDebugAddrSection (uint32_t index) const |
lldb::ByteOrder | GetByteOrder () const |
const DWARFDebugAranges & | GetFunctionAranges () |
void | SetBaseAddress (dw_addr_t base_addr) |
DWARFBaseDIE | GetUnitDIEOnly () |
DWARFDIE | DIE () |
DWARFDIE | GetDIE (dw_offset_t die_offset) |
DWARFUnit & | GetNonSkeletonUnit () |
void * | GetUserData () const |
void | SetUserData (void *d) |
bool | Supports_DW_AT_APPLE_objc_complete_type () |
bool | DW_AT_decl_file_attributes_are_invalid () |
bool | Supports_unnamed_objc_bitfields () |
SymbolFileDWARF & | GetSymbolFileDWARF () const |
DWARFProducer | GetProducer () |
llvm::VersionTuple | GetProducerVersion () |
uint64_t | GetDWARFLanguageType () |
bool | GetIsOptimized () |
const lldb_private::FileSpec & | GetCompilationDirectory () |
const lldb_private::FileSpec & | GetAbsolutePath () |
lldb_private::FileSpec | GetFile (size_t file_idx) |
lldb_private::FileSpec::Style | GetPathStyle () |
SymbolFileDWARFDwo * | GetDwoSymbolFile () |
die_iterator_range | dies () |
DIERef::Section | GetDebugSection () const |
uint8_t | GetUnitType () const |
bool | IsTypeUnit () const |
bool | IsSkeletonUnit () const |
Note that this check only works for DWARF5+. | |
std::optional< uint64_t > | GetStringOffsetSectionItem (uint32_t index) const |
llvm::Expected< DWARFRangeList > | FindRnglistFromOffset (dw_offset_t offset) |
Return a list of address ranges resulting from a (possibly encoded) range list starting at a given offset in the appropriate ranges section. | |
llvm::Expected< DWARFRangeList > | FindRnglistFromIndex (uint32_t index) |
Return a list of address ranges retrieved from an encoded range list whose offset is found via a table lookup given an index (DWARF v5 and later). | |
llvm::Expected< uint64_t > | GetRnglistOffset (uint32_t Index) |
Return a rangelist's offset based on an index. | |
std::optional< uint64_t > | GetLoclistOffset (uint32_t Index) |
std::unique_ptr< llvm::DWARFLocationTable > | GetLocationTable (const lldb_private::DataExtractor &data) const |
Return the location table for parsing the given location list data. | |
lldb_private::DWARFDataExtractor | GetLocationData () const |
bool | HasAny (llvm::ArrayRef< dw_tag_t > tags) |
Returns true if any DIEs in the unit match any DW_TAG values in tags. | |
const lldb_private::Status & | GetDwoError () const |
Get the fission .dwo file specific error for this compile unit. | |
void | SetDwoError (const lldb_private::Status &error) |
Set the fission .dwo file specific error for this compile unit. | |
![]() | |
UserID (lldb::user_id_t uid=LLDB_INVALID_UID) | |
Construct with optional user ID. | |
~UserID ()=default | |
Destructor. | |
void | Clear () |
Clears the object state. | |
lldb::user_id_t | GetID () const |
Get accessor for the user ID. | |
void | SetID (lldb::user_id_t uid) |
Set accessor for the user ID. | |
Static Public Member Functions | |
static llvm::Expected< DWARFUnitSP > | extract (SymbolFileDWARF &dwarf2Data, lldb::user_id_t uid, const lldb_private::DWARFDataExtractor &debug_info, DIERef::Section section, lldb::offset_t *offset_ptr) |
static uint8_t | GetAddressByteSize (const DWARFUnit *cu) |
static uint8_t | GetDefaultAddressSize () |
Protected Member Functions | |
DWARFUnit (SymbolFileDWARF &dwarf, lldb::user_id_t uid, const DWARFUnitHeader &header, const DWARFAbbreviationDeclarationSet &abbrevs, DIERef::Section section, bool is_dwo) | |
llvm::Error | ExtractHeader (SymbolFileDWARF &dwarf, const lldb_private::DWARFDataExtractor &data, lldb::offset_t *offset_ptr) |
const DWARFDebugInfoEntry * | GetUnitDIEPtrOnly () |
const DWARFDebugInfoEntry * | DIEPtr () |
const std::optional< llvm::DWARFDebugRnglistTable > & | GetRnglistTable () |
lldb_private::DWARFDataExtractor | GetRnglistData () const |
Private Types | |
using | die_iterator_range = llvm::iterator_range< DWARFDebugInfoEntry::collection::iterator > |
Private Member Functions | |
void | ParseProducerInfo () |
void | ExtractDIEsRWLocked () |
void | ClearDIEsRWLocked () |
void | AddUnitDIE (const DWARFDebugInfoEntry &cu_die) |
void | SetDwoStrOffsetsBase () |
void | ComputeCompDirAndGuessPathStyle () |
void | ComputeAbsolutePath () |
DWARFUnit (const DWARFUnit &)=delete | |
const DWARFUnit & | operator= (const DWARFUnit &)=delete |
Definition at line 84 of file DWARFUnit.h.
|
private |
Definition at line 85 of file DWARFUnit.h.
|
virtualdefault |
|
protected |
Definition at line 33 of file DWARFUnit.cpp.
|
privatedelete |
|
private |
Definition at line 373 of file DWARFUnit.cpp.
References DWARFFormValue::Address(), DWARFAttributes::AttributeAtIndex(), DWARFAttributes::ExtractFormValueAtIndex(), DWARFDebugInfoEntry::GetAttributes(), LLDB_INVALID_ADDRESS, m_base_addr, m_dwo_id, m_gnu_addr_base, m_gnu_ranges_base, m_has_parsed_non_skeleton_unit, m_is_dwo, m_line_table_offset, SetAddrBase(), SetBaseAddress(), SetDwoStrOffsetsBase(), SetLoclistsBase(), SetRangesBase(), SetStrOffsetsBase(), DWARFAttributes::Size(), and DWARFFormValue::Unsigned().
Referenced by ExtractDIEsRWLocked(), and ExtractUnitDIENoDwoIfNeeded().
|
pure virtual |
Implemented in DWARFCompileUnit, and DWARFTypeUnit.
Referenced by DWARFDebugInfo::GetCompileUnitAranges().
|
private |
Definition at line 616 of file DWARFUnit.cpp.
References m_die_array, and m_dwo.
|
private |
Definition at line 837 of file DWARFUnit.cpp.
References DWARFDebugInfoEntry::GetAttributeValueAsString(), GetCompilationDirectory(), GetPathStyle(), GetUnitDIEPtrOnly(), and m_file_spec.
Referenced by GetAbsolutePath().
|
private |
Definition at line 815 of file DWARFUnit.cpp.
References DWARFDebugInfoEntry::GetAttributeValueAsString(), GetUnitDIEPtrOnly(), lldb_private::FileSpec::GuessPathStyle(), m_comp_dir, and removeHostnameFromPathname().
Referenced by GetCompilationDirectory(), and GetPathStyle().
|
inline |
Definition at line 143 of file DWARFUnit.h.
References GetFirstDIEOffset(), and GetNextUnitOffset().
Referenced by GetDIE(), DWARFDebugInfo::GetUnitContainingDIEOffset(), and DWARFFormValue::Reference().
|
inline |
Definition at line 180 of file DWARFUnit.h.
References DIEPtr().
Referenced by DWARFCompileUnit::LookupAddress(), SymbolFileDWARF::ParseImportedModules(), and SymbolFileDWARF::ParseTypes().
|
inlineprotected |
Definition at line 312 of file DWARFUnit.h.
References ExtractDIEsIfNeeded(), and m_die_array.
Referenced by DIE(), and GetFunctionAranges().
|
inline |
Definition at line 217 of file DWARFUnit.h.
References ExtractDIEsIfNeeded(), and m_die_array.
Referenced by lldb_private::ManualDWARFIndex::IndexUnitImpl(), and SymbolFileDWARF::ParseFunctions().
|
pure virtual |
Implemented in DWARFCompileUnit, and DWARFTypeUnit.
bool DWARFUnit::DW_AT_decl_file_attributes_are_invalid | ( | ) |
Definition at line 686 of file DWARFUnit.cpp.
References eProducerLLVMGCC, and GetProducer().
|
static |
Definition at line 966 of file DWARFUnit.cpp.
References DWARFUnitHeader::extract(), DWARFDebugAbbrev::GetAbbreviationDeclarationSet(), and lldb_private::DataExtractor::ValidOffset().
Referenced by DWARFDebugInfo::ParseUnitsFor().
void DWARFUnit::ExtractDIEsIfNeeded | ( | ) |
Definition at line 140 of file DWARFUnit.cpp.
References ExtractDIEsRWLocked(), m_cancel_scopes, m_die_array, and m_die_array_mutex.
|
private |
Definition at line 213 of file DWARFUnit.cpp.
References AddUnitDIE(), elapsed(), DWARFDebugInfoEntry::Extract(), GetData(), SymbolFileDWARF::GetDebugInfoParseTimeRef(), GetDebugInfoSize(), GetFirstDIEOffset(), GetNextUnitOffset(), GetOffset(), DWARFDebugInfoEntry::HasChildren(), DWARFDebugInfoEntry::IsNULL(), LLDB_SCOPED_TIMERF, lldbassert, m_die_array, m_dwarf, m_dwo, m_first_die, m_first_die_mutex, DWARFDebugInfoEntry::SetHasChildren(), and DWARFDebugInfoEntry::SetParentIndex().
Referenced by ExtractDIEsIfNeeded(), and ExtractDIEsScoped().
DWARFUnit::ScopedExtractDIEs DWARFUnit::ExtractDIEsScoped | ( | ) |
Definition at line 160 of file DWARFUnit.cpp.
References ExtractDIEsRWLocked(), lldbassert, m_cancel_scopes, DWARFUnit::ScopedExtractDIEs::m_clear_dies, m_die_array, and m_die_array_mutex.
|
protected |
void DWARFUnit::ExtractUnitDIEIfNeeded | ( | ) |
Definition at line 71 of file DWARFUnit.cpp.
References lldb_private::Status::Clear(), lldb_private::Status::createWithFormat(), ExtractUnitDIENoDwoIfNeeded(), GetBaseAddress(), SymbolFileDWARF::GetDwoSymbolFileForCompileUnit(), DWARFDebugInfoEntry::GetOffset(), GetUnitDIEOnly(), GetVersion(), DWARFBaseDIE::IsValid(), m_addr_base, m_dwarf, m_dwo, m_dwo_error, m_dwo_id, m_first_die, m_gnu_addr_base, m_gnu_ranges_base, m_has_parsed_non_skeleton_unit, SetAddrBase(), SetBaseAddress(), SetDwoError(), SetLoclistsBase(), SetRangesBase(), and SetUserData().
Referenced by SymbolFileDWARF::CalculateFrameVariableError(), GetDwoSymbolFile(), GetNonSkeletonUnit(), and HasAny().
void DWARFUnit::ExtractUnitDIENoDwoIfNeeded | ( | ) |
Definition at line 44 of file DWARFUnit.cpp.
References AddUnitDIE(), elapsed(), DWARFDebugInfoEntry::Extract(), GetData(), SymbolFileDWARF::GetDebugInfoParseTimeRef(), GetFirstDIEOffset(), GetNextUnitOffset(), m_dwarf, m_first_die, and m_first_die_mutex.
Referenced by ExtractUnitDIEIfNeeded(), GetDWOId(), GetLineTableOffset(), and GetUnitDIEPtrOnly().
llvm::Expected< DWARFRangeList > DWARFUnit::FindRnglistFromIndex | ( | uint32_t | index | ) |
Return a list of address ranges retrieved from an encoded range list whose offset is found via a table lookup given an index (DWARF v5 and later).
Definition at line 1075 of file DWARFUnit.cpp.
References FindRnglistFromOffset(), and GetRnglistOffset().
Referenced by GetRangesOrReportError().
llvm::Expected< DWARFRangeList > DWARFUnit::FindRnglistFromOffset | ( | dw_offset_t | offset | ) |
Return a list of address ranges resulting from a (possibly encoded) range list starting at a given offset in the appropriate ranges section.
Definition at line 1030 of file DWARFUnit.cpp.
References lldb_private::RangeVector< B, S, N >::Append(), DWARFDebugRanges::FindRanges(), GetAddrBase(), DWARFUnitHeader::GetAddressByteSize(), GetAddressByteSize(), lldb_private::DWARFDataExtractor::GetAsLLVMDWARF(), GetBaseAddress(), SymbolFileDWARF::GetDebugRanges(), SymbolFileDWARF::GetDWARFContext(), lldb_private::DataExtractor::GetMaxU64(), lldb_private::DWARFContext::getOrLoadAddrData(), GetRnglistData(), GetRnglistTable(), GetVersion(), m_dwarf, and m_header.
Referenced by FindRnglistFromIndex(), and GetRangesOrReportError().
const DWARFAbbreviationDeclarationSet * DWARFUnit::GetAbbreviations | ( | ) | const |
Definition at line 438 of file DWARFUnit.cpp.
References m_abbrevs.
Referenced by DWARFDebugInfoEntry::GetAbbreviationDeclarationPtr().
dw_offset_t DWARFUnit::GetAbbrevOffset | ( | ) | const |
Definition at line 442 of file DWARFUnit.cpp.
References DW_INVALID_OFFSET, and m_abbrevs.
Referenced by DWARFCompileUnit::Dump(), and DWARFTypeUnit::Dump().
const FileSpec & DWARFUnit::GetAbsolutePath | ( | ) |
Definition at line 784 of file DWARFUnit.cpp.
References ComputeAbsolutePath(), and m_file_spec.
|
inline |
Definition at line 159 of file DWARFUnit.h.
References m_addr_base.
Referenced by DWARFFormValue::Address(), FindRnglistFromOffset(), and ReadAddressFromDebugAddrSection().
|
inline |
Definition at line 158 of file DWARFUnit.h.
References DWARFUnitHeader::GetAddressByteSize(), and m_header.
Referenced by DWARFFormValue::Address(), DWARFCompileUnit::Dump(), DWARFTypeUnit::Dump(), DWARFDebugInfoEntry::Extract(), DWARFFormValue::ExtractValue(), FindRnglistFromOffset(), GetAddressByteSize(), GetExprListFromAtConstValue(), DWARFFormValue::GetFixedSize(), SymbolFileDWARF::ParseVariableDIE(), ReadAddressFromDebugAddrSection(), and DWARFFormValue::SkipValue().
|
static |
Definition at line 670 of file DWARFUnit.cpp.
References GetAddressByteSize(), and GetDefaultAddressSize().
|
inline |
Definition at line 160 of file DWARFUnit.h.
References m_base_addr.
Referenced by ExtractUnitDIEIfNeeded(), DWARFDebugRanges::FindRanges(), FindRnglistFromOffset(), DWARFDebugInfoEntry::GetDIENamesAndRanges(), and lldb_private::DWARFExpression::ParseDWARFLocationList().
lldb::ByteOrder DWARFUnit::GetByteOrder | ( | ) | const |
Definition at line 624 of file DWARFUnit.cpp.
References lldb_private::ObjectFile::GetByteOrder(), lldb_private::SymbolFileCommon::GetObjectFile(), and m_dwarf.
Referenced by GetExprListFromAtConstValue().
const FileSpec & DWARFUnit::GetCompilationDirectory | ( | ) |
Definition at line 778 of file DWARFUnit.cpp.
References ComputeCompDirAndGuessPathStyle(), and m_comp_dir.
Referenced by ComputeAbsolutePath(), MakeAbsoluteAndRemap(), and SymbolFileDWARF::ParseSupportFiles().
const lldb_private::DWARFDataExtractor & DWARFUnit::GetData | ( | ) | const |
Get the data that contains the DIE information for this unit.
This will return the correct bytes that contain the data for this DWARFUnit. It could be .debug_info or .debug_types depending on where the data for this unit originates.
Definition at line 1002 of file DWARFUnit.cpp.
References DIERef::DebugTypes, SymbolFileDWARF::GetDWARFContext(), lldb_private::DWARFContext::getOrLoadDebugInfoData(), lldb_private::DWARFContext::getOrLoadDebugTypesData(), m_dwarf, and m_section.
Referenced by ExtractDIEsRWLocked(), DWARFAttributes::ExtractFormValueAtIndex(), ExtractUnitDIENoDwoIfNeeded(), DWARFDebugInfoEntry::GetAttributes(), DWARFDebugInfoEntry::GetAttributeValue(), DWARFBaseDIE::GetData(), and DWARFDebugInfoEntry::GetDIENamesAndRanges().
size_t DWARFUnit::GetDebugInfoSize | ( | ) | const |
Definition at line 434 of file DWARFUnit.cpp.
References GetHeaderByteSize(), GetLength(), and GetLengthByteSize().
Referenced by ExtractDIEsRWLocked().
|
inline |
Definition at line 222 of file DWARFUnit.h.
References m_section.
Referenced by NameToDIE::FindAllEntriesForUnit(), and DWARFBaseDIE::GetDIERef().
|
static |
Definition at line 676 of file DWARFUnit.cpp.
Referenced by GetAddressByteSize().
DWARFDIE DWARFUnit::GetDIE | ( | dw_offset_t | die_offset | ) |
Definition at line 642 of file DWARFUnit.cpp.
References CompareDIEOffset(), ContainsDIEOffset(), DW_INVALID_OFFSET, ExtractDIEsIfNeeded(), lldb_private::ModuleChild::GetModule(), lldb_private::SymbolFileCommon::GetObjectFile(), GetOffset(), GetSymbolFileDWARF(), and m_die_array.
Referenced by DWARFDebugInfo::GetDIE(), DWARFDIE::GetDIE(), lldb_private::ManualDWARFIndex::IndexUnit(), DWARFCompileUnit::LookupAddress(), SymbolFileDWARF::ParseBlocksRecursive(), and DWARFFormValue::Reference().
uint64_t DWARFUnit::GetDWARFLanguageType | ( | ) |
Definition at line 746 of file DWARFUnit.cpp.
References DWARFDebugInfoEntry::GetAttributeValueAsUnsigned(), GetUnitDIEPtrOnly(), and m_language_type.
Referenced by SymbolFileDWARF::CalculateFrameVariableError(), SymbolFileDWARF::GetLanguage(), SymbolFileDWARF::GetLanguageFamily(), DWARFASTParserClang::ParseChildMembers(), and SymbolFileDWARF::ParseCompileUnit().
|
inline |
Get the fission .dwo file specific error for this compile unit.
The skeleton compile unit only can have a DWO error. Any other type of DWARFUnit will not have a valid DWO error.
Definition at line 281 of file DWARFUnit.h.
References m_dwo_error.
Referenced by SymbolFileDWARF::CalculateFrameVariableError().
std::optional< uint64_t > DWARFUnit::GetDWOId | ( | ) |
Definition at line 367 of file DWARFUnit.cpp.
References ExtractUnitDIENoDwoIfNeeded(), and m_dwo_id.
Referenced by SymbolFileDWARFDwo::GetDWOCompileUnitForHash(), SymbolFileDWARF::GetDwoSymbolFileForCompileUnit(), lldb_private::ManualDWARFIndex::IndexUnit(), and SetLoclistsBase().
SymbolFileDWARFDwo * DWARFUnit::GetDwoSymbolFile | ( | ) |
Definition at line 851 of file DWARFUnit.cpp.
References ExtractUnitDIEIfNeeded(), and m_dwo.
Referenced by SymbolFileDWARF::GetDIE(), SymbolFileDWARF::GetMangledNamesForFunction(), and lldb_private::ManualDWARFIndex::IndexUnit().
FileSpec DWARFUnit::GetFile | ( | size_t | file_idx | ) |
Definition at line 790 of file DWARFUnit.cpp.
References SymbolFileDWARF::GetFile(), and m_dwarf.
Referenced by DWARFASTParserClang::ParseChildEnumerators(), ParsedDWARFTypeAttributes::ParsedDWARFTypeAttributes(), DWARFASTParserClang::ParseFunctionFromDWARF(), and SymbolFileDWARF::ParseVariableDIE().
|
inline |
Definition at line 147 of file DWARFUnit.h.
References GetHeaderByteSize(), and GetOffset().
Referenced by ContainsDIEOffset(), ExtractDIEsRWLocked(), ExtractUnitDIENoDwoIfNeeded(), and lldb_private::ManualDWARFIndex::IndexUnit().
const DWARFDebugAranges & DWARFUnit::GetFunctionAranges | ( | ) |
Definition at line 858 of file DWARFUnit.cpp.
References DWARFDebugInfoEntry::BuildFunctionAddressRangeTable(), DIEPtr(), m_dwo, and m_func_aranges_up.
Referenced by DWARFCompileUnit::LookupAddress().
uint32_t DWARFUnit::GetHeaderByteSize | ( | ) | const |
Get the size in bytes of the unit header.
Definition at line 1008 of file DWARFUnit.cpp.
References DWARFUnitHeader::GetUnitType(), GetVersion(), and m_header.
Referenced by GetDebugInfoSize(), and GetFirstDIEOffset().
bool DWARFUnit::GetIsOptimized | ( | ) |
Definition at line 758 of file DWARFUnit.cpp.
References lldb_private::eLazyBoolCalculate, lldb_private::eLazyBoolNo, lldb_private::eLazyBoolYes, DWARFDebugInfoEntry::GetAttributeValueAsUnsigned(), GetUnitDIEPtrOnly(), and m_is_optimized.
Referenced by SymbolFileDWARF::ParseIsOptimized().
|
inline |
Definition at line 154 of file DWARFUnit.h.
References DWARFUnitHeader::GetLength(), and m_header.
Referenced by DWARFCompileUnit::Dump(), DWARFTypeUnit::Dump(), and GetDebugInfoSize().
|
inline |
Get the size in bytes of the length field in the header.
In DWARF32 this is just 4 bytes
Definition at line 141 of file DWARFUnit.h.
Referenced by GetDebugInfoSize().
dw_offset_t DWARFUnit::GetLineTableOffset | ( | ) |
Definition at line 446 of file DWARFUnit.cpp.
References ExtractUnitDIENoDwoIfNeeded(), and m_line_table_offset.
Referenced by SymbolFileDWARF::GetTypeUnitSupportFiles(), SymbolFileDWARF::ParseLineTable(), and SymbolFileDWARF::ParseSupportFiles().
DWARFDataExtractor DWARFUnit::GetLocationData | ( | ) | const |
Definition at line 524 of file DWARFUnit.cpp.
References SymbolFileDWARF::GetDWARFContext(), DWARFUnitHeader::GetIndexEntry(), lldb_private::DWARFContext::getOrLoadLocData(), lldb_private::DWARFContext::getOrLoadLocListsData(), GetSymbolFileDWARF(), GetVersion(), and m_header.
Referenced by DWARFDebugInfoEntry::GetDIENamesAndRanges(), and GetExprListFromAtLocation().
std::unique_ptr< llvm::DWARFLocationTable > DWARFUnit::GetLocationTable | ( | const lldb_private::DataExtractor & | data | ) | const |
Return the location table for parsing the given location list data.
The format is chosen according to the unit type. Never returns null.
Definition at line 514 of file DWARFUnit.cpp.
References lldb::eByteOrderLittle, lldb_private::DataExtractor::GetAddressByteSize(), lldb_private::DataExtractor::GetByteOrder(), lldb_private::DataExtractor::GetData(), GetVersion(), and m_is_dwo.
Referenced by lldb_private::DWARFExpression::ParseDWARFLocationList().
|
inline |
Definition at line 245 of file DWARFUnit.h.
References lldb_private::DWARFDataExtractor::GetAsLLVM(), SymbolFileDWARF::GetDWARFContext(), lldb_private::DWARFContext::getOrLoadLocListsData(), m_dwarf, m_loclist_table_header, and m_loclists_base.
Referenced by GetExprListFromAtLocation().
|
inline |
Definition at line 150 of file DWARFUnit.h.
References DWARFUnitHeader::GetNextUnitOffset(), and m_header.
Referenced by ContainsDIEOffset(), DWARFCompileUnit::Dump(), DWARFTypeUnit::Dump(), ExtractDIEsRWLocked(), ExtractUnitDIENoDwoIfNeeded(), NameToDIE::FindAllEntriesForUnit(), and lldb_private::AppleDWARFIndex::GetGlobalVariables().
DWARFUnit & DWARFUnit::GetNonSkeletonUnit | ( | ) |
Definition at line 663 of file DWARFUnit.cpp.
References ExtractUnitDIEIfNeeded(), and m_dwo.
Referenced by NameToDIE::FindAllEntriesForUnit(), DWARFDebugInfo::GetDIE(), lldb_private::AppleDWARFIndex::GetGlobalVariables(), DWARFCompileUnit::GetNonSkeletonUnit(), lldb_private::ManualDWARFIndex::IndexUnit(), SymbolFileDWARF::ParseBlocksRecursive(), SymbolFileDWARF::ParseFunctions(), SymbolFileDWARF::ParseIsOptimized(), SymbolFileDWARF::ParseLanguage(), SymbolFileDWARF::ParseXcodeSDK(), and lldb_private::DebugNamesDWARFIndex::ToDIERef().
|
inline |
Definition at line 134 of file DWARFUnit.h.
References DWARFUnitHeader::GetOffset(), and m_header.
Referenced by DWARFCompileUnit::BuildAddressRangeTable(), DWARFFormValue::Dump(), DWARFCompileUnit::Dump(), DWARFTypeUnit::Dump(), lldb_private::DWARFExpression::Evaluate(), ExtractDIEsRWLocked(), NameToDIE::FindAllEntriesForUnit(), DWARFDebugInfo::GetCompileUnitAranges(), GetDIE(), GetFirstDIEOffset(), lldb_private::AppleDWARFIndex::GetGlobalVariables(), lldb_private::DebugNamesDWARFIndex::GetGlobalVariables(), GetRnglistOffset(), DWARFTypeUnit::GetTypeOffset(), DWARFDebugInfo::GetUnitAtOffset(), lldb_private::ManualDWARFIndex::Index(), lldb_private::ManualDWARFIndex::IndexUnit(), SymbolFileDWARF::ParseLineTable(), SymbolFileDWARF::ParseSupportFiles(), DWARFFormValue::Reference(), and lldb_private::DebugNamesDWARFIndex::ToDIERef().
FileSpec::Style DWARFUnit::GetPathStyle | ( | ) |
Definition at line 772 of file DWARFUnit.cpp.
References ComputeCompDirAndGuessPathStyle(), and m_comp_dir.
Referenced by ComputeAbsolutePath(), SymbolFileDWARF::GetTypeUnitSupportFiles(), SymbolFileDWARF::ParseCompileUnit(), SymbolFileDWARF::ParseImportedModules(), and SymbolFileDWARF::ParseSupportFiles().
DWARFProducer DWARFUnit::GetProducer | ( | ) |
Definition at line 734 of file DWARFUnit.cpp.
References eProducerInvalid, m_producer, and ParseProducerInfo().
Referenced by DW_AT_decl_file_attributes_are_invalid(), Supports_DW_AT_APPLE_objc_complete_type(), and Supports_unnamed_objc_bitfields().
llvm::VersionTuple DWARFUnit::GetProducerVersion | ( | ) |
Definition at line 740 of file DWARFUnit.cpp.
References m_producer_version, and ParseProducerInfo().
Referenced by Supports_unnamed_objc_bitfields().
|
inline |
Definition at line 162 of file DWARFUnit.h.
References m_ranges_base.
Referenced by DWARFDebugRanges::FindRanges().
|
protected |
Definition at line 538 of file DWARFUnit.cpp.
References SymbolFileDWARF::GetDWARFContext(), DWARFUnitHeader::GetIndexEntry(), lldb_private::ModuleChild::GetModule(), lldb_private::SymbolFileCommon::GetObjectFile(), lldb_private::DWARFContext::getOrLoadRngListsData(), GetSymbolFileDWARF(), and m_header.
Referenced by FindRnglistFromOffset(), GetRnglistOffset(), and GetRnglistTable().
llvm::Expected< uint64_t > DWARFUnit::GetRnglistOffset | ( | uint32_t | Index | ) |
Return a rangelist's offset based on an index.
The index designates an entry in the rangelist table's offset array and is supplied by DW_FORM_rnglistx.
Definition at line 578 of file DWARFUnit.cpp.
References GetOffset(), GetRnglistData(), GetRnglistTable(), and m_ranges_base.
Referenced by FindRnglistFromIndex().
|
protected |
Definition at line 562 of file DWARFUnit.cpp.
References lldb_private::ModuleChild::GetModule(), lldb_private::SymbolFileCommon::GetObjectFile(), GetRnglistData(), GetSymbolFileDWARF(), GetVersion(), m_ranges_base, m_rnglist_table, m_rnglist_table_done, and lldb_private::toString().
Referenced by FindRnglistFromOffset(), and GetRnglistOffset().
std::optional< uint64_t > DWARFUnit::GetStringOffsetSectionItem | ( | uint32_t | index | ) | const |
Definition at line 1024 of file DWARFUnit.cpp.
References SymbolFileDWARF::GetDWARFContext(), lldb_private::DWARFContext::getOrLoadStrOffsetsData(), GetStrOffsetsBase(), lldb_private::DataExtractor::GetU32(), and m_dwarf.
Referenced by DWARFFormValue::AsCString().
|
inline |
Definition at line 163 of file DWARFUnit.h.
References m_str_offsets_base.
Referenced by GetStringOffsetSectionItem().
|
inline |
Definition at line 200 of file DWARFUnit.h.
References m_dwarf.
Referenced by DWARFFormValue::Address(), DWARFFormValue::AsCString(), DWARFCompileUnit::BuildAddressRangeTable(), lldb_private::DWARFExpression::Evaluate(), DWARFDebugInfoEntry::Extract(), NameToDIE::FindAllEntriesForUnit(), SymbolFileDWARF::GetCompUnitForDWARFCompUnit(), GetDIE(), DWARFDebugInfoEntry::GetDIENamesAndRanges(), DWARFBaseDIE::GetDIERef(), DWARFBaseDIE::GetDWARF(), GetLocationData(), GetOpcodeDataSize(), GetRangesOrReportError(), GetRnglistData(), GetRnglistTable(), SymbolFileDWARF::GetTypeSystem(), DWARFASTParserClang::ParseTypeFromClangModule(), DWARFFormValue::Reference(), SetDwoStrOffsetsBase(), SetLoclistsBase(), and lldb_private::DebugNamesDWARFIndex::ToDIERef().
|
inline |
Definition at line 178 of file DWARFUnit.h.
References GetUnitDIEPtrOnly().
Referenced by ExtractUnitDIEIfNeeded(), SymbolFileDWARF::GetCompileOptions(), SymbolFileDWARF::ParseCompileUnit(), SymbolFileDWARF::ParseDebugMacros(), and SymbolFileDWARF::ParseXcodeSDK().
|
inlineprotected |
Definition at line 303 of file DWARFUnit.h.
References ExtractUnitDIENoDwoIfNeeded(), and m_first_die.
Referenced by DWARFCompileUnit::BuildAddressRangeTable(), ComputeAbsolutePath(), ComputeCompDirAndGuessPathStyle(), GetDWARFLanguageType(), GetIsOptimized(), GetUnitDIEOnly(), and ParseProducerInfo().
|
inline |
Definition at line 224 of file DWARFUnit.h.
References DWARFUnitHeader::GetUnitType(), and m_header.
Referenced by IsSkeletonUnit().
void * DWARFUnit::GetUserData | ( | ) | const |
Definition at line 678 of file DWARFUnit.cpp.
References m_user_data.
Referenced by SymbolFileDWARF::GetCompUnitForDWARFCompUnit(), SymbolFileDWARF::GetDWARFCompileUnit(), and SymbolFileDWARF::ParseCompileUnit().
|
inline |
Definition at line 155 of file DWARFUnit.h.
References DWARFUnitHeader::GetVersion(), and m_header.
Referenced by DWARFFormValue::Dump(), DWARFCompileUnit::Dump(), DWARFTypeUnit::Dump(), DWARFDebugInfoEntry::Extract(), ExtractUnitDIEIfNeeded(), DWARFFormValue::ExtractValue(), FindRnglistFromOffset(), GetHeaderByteSize(), GetLocationData(), GetLocationTable(), GetRnglistTable(), lldb_private::ManualDWARFIndex::IndexUnit(), SymbolFileDWARF::ParseCompileUnit(), SetDwoStrOffsetsBase(), and DWARFFormValue::SkipValue().
bool DWARFUnit::HasAny | ( | llvm::ArrayRef< dw_tag_t > | tags | ) |
Returns true if any DIEs in the unit match any DW_TAG values in tags.
[in] | tags | An array of dw_tag_t values to check all abbrevitions for. |
Definition at line 1083 of file DWARFUnit.cpp.
References ExtractUnitDIEIfNeeded(), m_die_array, and m_dwo.
Referenced by SymbolFileDWARF::CalculateFrameVariableError().
|
inline |
Definition at line 95 of file DWARFUnit.h.
References m_is_dwo.
Referenced by SymbolFileDWARF::GetCompUnitForDWARFCompUnit().
|
inline |
Note that this check only works for DWARF5+.
Definition at line 227 of file DWARFUnit.h.
References GetUnitType().
Referenced by lldb_private::ManualDWARFIndex::IndexUnit().
|
inline |
Definition at line 225 of file DWARFUnit.h.
References DWARFUnitHeader::IsTypeUnit(), and m_header.
Referenced by DWARFCompileUnit::classof(), and DWARFTypeUnit::classof().
|
private |
Definition at line 699 of file DWARFUnit.cpp.
References eProducerClang, eProducerGCC, eProducerLLVMGCC, eProducerOther, eProducerSwift, lldb_private::RegularExpression::Execute(), DWARFDebugInfoEntry::GetAttributeValueAsString(), GetUnitDIEPtrOnly(), m_producer, and m_producer_version.
Referenced by GetProducer(), and GetProducerVersion().
dw_addr_t DWARFUnit::ReadAddressFromDebugAddrSection | ( | uint32_t | index | ) | const |
Definition at line 604 of file DWARFUnit.cpp.
References GetAddrBase(), GetAddressByteSize(), SymbolFileDWARF::GetDWARFContext(), lldb_private::DataExtractor::GetMaxU64_unchecked(), lldb_private::DWARFContext::getOrLoadAddrData(), LLDB_INVALID_ADDRESS, and m_dwarf.
Referenced by lldb_private::DWARFExpression::Evaluate(), lldb_private::DWARFExpression::GetLocation_DW_OP_addr(), and lldb_private::DWARFExpression::ParseDWARFLocationList().
void DWARFUnit::SetAddrBase | ( | dw_addr_t | addr_base | ) |
Definition at line 451 of file DWARFUnit.cpp.
References m_addr_base.
Referenced by AddUnitDIE(), and ExtractUnitDIEIfNeeded().
void DWARFUnit::SetBaseAddress | ( | dw_addr_t | base_addr | ) |
Definition at line 628 of file DWARFUnit.cpp.
References m_base_addr.
Referenced by AddUnitDIE(), and ExtractUnitDIEIfNeeded().
|
inline |
Set the fission .dwo file specific error for this compile unit.
This helps tracks issues that arise when trying to locate or parse a .dwo file. Things like a missing .dwo file, DWO ID mismatch, and other .dwo errors can be stored in each compile unit so the issues can be communicated to the user.
Definition at line 289 of file DWARFUnit.h.
References error(), and m_dwo_error.
Referenced by ExtractUnitDIEIfNeeded(), and SymbolFileDWARF::GetDwoSymbolFileForCompileUnit().
|
private |
Definition at line 338 of file DWARFUnit.cpp.
References SymbolFileDWARF::GetDWARFContext(), DWARFUnitHeader::GetIndexEntry(), lldb_private::DWARFContext::getOrLoadStrOffsetsData(), GetSymbolFileDWARF(), lldb_private::DataExtractor::GetU16(), lldb_private::DataExtractor::GetU32(), lldb_private::DataExtractor::GetU64(), GetVersion(), m_header, and SetStrOffsetsBase().
Referenced by AddUnitDIE().
void DWARFUnit::SetLoclistsBase | ( | dw_addr_t | loclists_base | ) |
Definition at line 482 of file DWARFUnit.cpp.
References lldb_private::DWARFDataExtractor::GetAsLLVMDWARF(), SymbolFileDWARF::GetDWARFContext(), GetDWOId(), DWARFUnitHeader::GetIndexEntry(), lldb_private::ModuleChild::GetModule(), lldb_private::SymbolFileCommon::GetObjectFile(), lldb_private::DWARFContext::getOrLoadLocListsData(), GetSymbolFileDWARF(), m_dwarf, m_header, m_loclist_table_header, m_loclists_base, and lldb_private::toString().
Referenced by AddUnitDIE(), and ExtractUnitDIEIfNeeded().
void DWARFUnit::SetRangesBase | ( | dw_addr_t | ranges_base | ) |
Definition at line 555 of file DWARFUnit.cpp.
References lldbassert, m_ranges_base, and m_rnglist_table_done.
Referenced by AddUnitDIE(), and ExtractUnitDIEIfNeeded().
void DWARFUnit::SetStrOffsetsBase | ( | dw_offset_t | str_offsets_base | ) |
Definition at line 600 of file DWARFUnit.cpp.
References m_str_offsets_base.
Referenced by AddUnitDIE(), and SetDwoStrOffsetsBase().
void DWARFUnit::SetUserData | ( | void * | d | ) |
Definition at line 680 of file DWARFUnit.cpp.
References m_user_data.
Referenced by ExtractUnitDIEIfNeeded(), SymbolFileDWARF::GetDWARFCompileUnit(), and SymbolFileDWARF::ParseCompileUnit().
bool DWARFUnit::Supports_DW_AT_APPLE_objc_complete_type | ( | ) |
Definition at line 682 of file DWARFUnit.cpp.
References eProducerLLVMGCC, and GetProducer().
Referenced by lldb_private::DebugNamesDWARFIndex::GetCompleteObjCClass(), and SymbolFileDWARF::Supports_DW_AT_APPLE_objc_complete_type().
bool DWARFUnit::Supports_unnamed_objc_bitfields | ( | ) |
Definition at line 692 of file DWARFUnit.cpp.
References eProducerClang, GetProducer(), and GetProducerVersion().
Referenced by DWARFASTParserClang::ParseSingleMember().
bool DWARFUnit::Verify | ( | lldb_private::Stream * | s | ) | const |
|
protected |
Definition at line 326 of file DWARFUnit.h.
Referenced by GetAbbreviations(), and GetAbbrevOffset().
|
protected |
Value of DW_AT_addr_base.
Definition at line 351 of file DWARFUnit.h.
Referenced by ExtractUnitDIEIfNeeded(), GetAddrBase(), and SetAddrBase().
|
protected |
Definition at line 344 of file DWARFUnit.h.
Referenced by AddUnitDIE(), GetBaseAddress(), and SetBaseAddress().
|
protected |
Definition at line 335 of file DWARFUnit.h.
Referenced by ExtractDIEsIfNeeded(), and ExtractDIEsScoped().
|
protected |
Definition at line 349 of file DWARFUnit.h.
Referenced by ComputeCompDirAndGuessPathStyle(), GetCompilationDirectory(), and GetPathStyle().
|
protected |
Definition at line 329 of file DWARFUnit.h.
Referenced by ClearDIEsRWLocked(), DIEPtr(), dies(), ExtractDIEsIfNeeded(), ExtractDIEsRWLocked(), ExtractDIEsScoped(), GetDIE(), and HasAny().
|
mutableprotected |
Definition at line 330 of file DWARFUnit.h.
Referenced by ExtractDIEsIfNeeded(), and ExtractDIEsScoped().
|
mutableprotected |
Definition at line 332 of file DWARFUnit.h.
Referenced by DWARFUnit::ScopedExtractDIEs::ScopedExtractDIEs().
|
protected |
Definition at line 323 of file DWARFUnit.h.
Referenced by DWARFCompileUnit::BuildAddressRangeTable(), ExtractDIEsRWLocked(), ExtractUnitDIEIfNeeded(), ExtractUnitDIENoDwoIfNeeded(), FindRnglistFromOffset(), GetByteOrder(), GetData(), GetFile(), GetLoclistOffset(), GetStringOffsetSectionItem(), GetSymbolFileDWARF(), ReadAddressFromDebugAddrSection(), and SetLoclistsBase().
|
protected |
Definition at line 324 of file DWARFUnit.h.
Referenced by ClearDIEsRWLocked(), ExtractDIEsRWLocked(), ExtractUnitDIEIfNeeded(), GetDwoSymbolFile(), GetFunctionAranges(), GetNonSkeletonUnit(), and HasAny().
|
protected |
If we get an error when trying to load a .dwo file, save that error here.
Errors include .dwo/.dwp file not found, or the .dwp/.dwp file was found but DWO ID doesn't match, etc.
Definition at line 374 of file DWARFUnit.h.
Referenced by ExtractUnitDIEIfNeeded(), GetDwoError(), and SetDwoError().
|
protected |
Value of DW_AT_GNU_dwo_id (v4) or dwo_id from CU header (v5).
Definition at line 370 of file DWARFUnit.h.
Referenced by AddUnitDIE(), ExtractUnitDIEIfNeeded(), and GetDWOId().
|
protected |
Definition at line 350 of file DWARFUnit.h.
Referenced by ComputeAbsolutePath(), and GetAbsolutePath().
|
protected |
Definition at line 339 of file DWARFUnit.h.
Referenced by ExtractDIEsRWLocked(), ExtractUnitDIEIfNeeded(), ExtractUnitDIENoDwoIfNeeded(), and GetUnitDIEPtrOnly().
|
protected |
Definition at line 340 of file DWARFUnit.h.
Referenced by ExtractDIEsRWLocked(), and ExtractUnitDIENoDwoIfNeeded().
|
protected |
Definition at line 343 of file DWARFUnit.h.
Referenced by GetFunctionAranges().
|
protected |
Definition at line 354 of file DWARFUnit.h.
Referenced by AddUnitDIE(), and ExtractUnitDIEIfNeeded().
|
protected |
Definition at line 355 of file DWARFUnit.h.
Referenced by AddUnitDIE(), and ExtractUnitDIEIfNeeded().
|
protected |
Definition at line 368 of file DWARFUnit.h.
Referenced by AddUnitDIE(), and ExtractUnitDIEIfNeeded().
|
protected |
Definition at line 325 of file DWARFUnit.h.
Referenced by FindRnglistFromOffset(), GetAddressByteSize(), GetHeaderByteSize(), GetLength(), GetLocationData(), GetNextUnitOffset(), GetOffset(), GetRnglistData(), DWARFTypeUnit::GetTypeHash(), DWARFTypeUnit::GetTypeOffset(), GetUnitType(), GetVersion(), IsTypeUnit(), SetDwoStrOffsetsBase(), and SetLoclistsBase().
|
protected |
Definition at line 367 of file DWARFUnit.h.
Referenced by AddUnitDIE(), GetLocationTable(), and IsDWOUnit().
|
protected |
Definition at line 348 of file DWARFUnit.h.
Referenced by GetIsOptimized().
|
protected |
Definition at line 347 of file DWARFUnit.h.
Referenced by GetDWARFLanguageType().
|
protected |
Value of DW_AT_stmt_list.
Definition at line 358 of file DWARFUnit.h.
Referenced by AddUnitDIE(), and GetLineTableOffset().
|
protected |
Definition at line 364 of file DWARFUnit.h.
Referenced by GetLoclistOffset(), and SetLoclistsBase().
|
protected |
Value of DW_AT_loclists_base.
Definition at line 352 of file DWARFUnit.h.
Referenced by GetLoclistOffset(), and SetLoclistsBase().
|
protected |
Definition at line 345 of file DWARFUnit.h.
Referenced by GetProducer(), and ParseProducerInfo().
|
protected |
Definition at line 346 of file DWARFUnit.h.
Referenced by GetProducerVersion(), and ParseProducerInfo().
|
protected |
Value of DW_AT_rnglists_base.
Definition at line 353 of file DWARFUnit.h.
Referenced by GetRangesBase(), GetRnglistOffset(), GetRnglistTable(), and SetRangesBase().
|
protected |
Definition at line 362 of file DWARFUnit.h.
Referenced by GetRnglistTable().
|
protected |
Definition at line 363 of file DWARFUnit.h.
Referenced by GetRnglistTable(), and SetRangesBase().
|
protected |
Definition at line 366 of file DWARFUnit.h.
Referenced by GetData(), and GetDebugSection().
|
protected |
Definition at line 360 of file DWARFUnit.h.
Referenced by GetStrOffsetsBase(), and SetStrOffsetsBase().
|
protected |
Definition at line 327 of file DWARFUnit.h.
Referenced by GetUserData(), and SetUserData().