LLDB mainline
|
#include <DebugNamesDWARFIndex.h>
Public Member Functions | |
void | Preload () override |
void | GetGlobalVariables (ConstString basename, llvm::function_ref< IterationAction(DWARFDIE die)> callback) override |
Finds global variables with the given base name. | |
void | GetGlobalVariables (const RegularExpression ®ex, llvm::function_ref< IterationAction(DWARFDIE die)> callback) override |
void | GetGlobalVariables (DWARFUnit &cu, llvm::function_ref< IterationAction(DWARFDIE die)> callback) override |
cu must be the skeleton unit if possible, not GetNonSkeletonUnit(). | |
void | GetObjCMethods (ConstString class_name, llvm::function_ref< IterationAction(DWARFDIE die)> callback) override |
void | GetCompleteObjCClass (ConstString class_name, bool must_be_implementation, llvm::function_ref< IterationAction(DWARFDIE die)> callback) override |
void | GetFullyQualifiedType (const DWARFDeclContext &context, llvm::function_ref< IterationAction(DWARFDIE die)> callback) override |
Uses DWARF5's IDX_parent fields, when available, to speed up this query. | |
void | GetTypes (ConstString name, llvm::function_ref< IterationAction(DWARFDIE die)> callback) override |
void | GetTypes (const DWARFDeclContext &context, llvm::function_ref< IterationAction(DWARFDIE die)> callback) override |
void | GetNamespaces (ConstString name, llvm::function_ref< IterationAction(DWARFDIE die)> callback) override |
void | GetTypesWithQuery (TypeQuery &query, llvm::function_ref< IterationAction(DWARFDIE die)> callback) override |
Get type DIEs meeting requires of query. | |
void | GetNamespacesWithParents (ConstString name, const CompilerDeclContext &parent_decl_ctx, llvm::function_ref< IterationAction(DWARFDIE die)> callback) override |
Get namespace DIEs whose base name match. | |
void | GetFunctions (const Module::LookupInfo &lookup_info, SymbolFileDWARF &dwarf, const CompilerDeclContext &parent_decl_ctx, llvm::function_ref< IterationAction(DWARFDIE die)> callback) override |
void | GetFunctions (const RegularExpression ®ex, llvm::function_ref< IterationAction(DWARFDIE die)> callback) override |
void | Dump (Stream &s) override |
Public Member Functions inherited from lldb_private::plugin::dwarf::DWARFIndex | |
DWARFIndex (Module &module) | |
virtual | ~DWARFIndex () |
StatsDuration::Duration | GetIndexTime () |
void | ResetStatistics () |
Static Public Member Functions | |
static llvm::Expected< std::unique_ptr< DebugNamesDWARFIndex > > | Create (Module &module, DWARFDataExtractor debug_names, DWARFDataExtractor debug_str, SymbolFileDWARF &dwarf) |
Private Types | |
using | DebugNames = llvm::DWARFDebugNames |
Private Member Functions | |
DebugNamesDWARFIndex (Module &module, std::unique_ptr< llvm::DWARFDebugNames > debug_names_up, DWARFDataExtractor debug_names_data, DWARFDataExtractor debug_str_data, SymbolFileDWARF &dwarf) | |
DWARFUnit * | GetNonSkeletonUnit (const DebugNames::Entry &entry) const |
DWARFDIE | GetDIE (const DebugNames::Entry &entry) const |
std::optional< DWARFTypeUnit * > | GetForeignTypeUnit (const DebugNames::Entry &entry) const |
Checks if an entry is a foreign TU and fetch the type unit. | |
IterationAction | ProcessEntry (const DebugNames::Entry &entry, llvm::function_ref< IterationAction(DWARFDIE die)> callback) |
bool | SameParentChain (llvm::ArrayRef< llvm::StringRef > parent_names, llvm::ArrayRef< DebugNames::Entry > parent_entries) const |
Returns true if parent_entries have identical names to parent_names. | |
bool | SameParentChain (llvm::ArrayRef< CompilerContext > parent_contexts, llvm::ArrayRef< DebugNames::Entry > parent_entries) const |
bool | WithinParentChain (llvm::ArrayRef< CompilerContext > parent_contexts, llvm::ArrayRef< DebugNames::Entry > parent_chain) const |
Returns true if parent_contexts entries are within parent_chain. | |
bool | SameAsEntryContext (const CompilerContext &query_context, const DebugNames::Entry &entry) const |
Returns true if .debug_names pool entry entry matches query_context . | |
llvm::SmallVector< CompilerContext > | GetTypeQueryParentContexts (TypeQuery &query) |
Static Private Member Functions | |
static void | MaybeLogLookupError (llvm::Error error, const DebugNames::NameIndex &ni, llvm::StringRef name) |
static llvm::DenseSet< dw_offset_t > | GetUnits (const DebugNames &debug_names) |
static llvm::DenseSet< uint64_t > | GetTypeUnitSignatures (const DebugNames &debug_names) |
Private Attributes | |
DWARFDebugInfo & | m_debug_info |
DWARFDataExtractor | m_debug_names_data |
DWARFDataExtractor | m_debug_str_data |
std::unique_ptr< DebugNames > | m_debug_names_up |
ManualDWARFIndex | m_fallback |
Additional Inherited Members | |
Protected Member Functions inherited from lldb_private::plugin::dwarf::DWARFIndex | |
IterationAction | ProcessFunctionDIE (const Module::LookupInfo &lookup_info, DWARFDIE die, const CompilerDeclContext &parent_decl_ctx, llvm::function_ref< IterationAction(DWARFDIE die)> callback) |
Helper function implementing common logic for processing function dies. | |
DIERefCallbackImpl | DIERefCallback (llvm::function_ref< IterationAction(DWARFDIE die)> callback, llvm::StringRef name={}) const |
void | ReportInvalidDIERef (DIERef ref, llvm::StringRef name) const |
IterationAction | GetFullyQualifiedTypeImpl (const DWARFDeclContext &context, DWARFDIE die, llvm::function_ref< IterationAction(DWARFDIE die)> callback) |
Implementation of GetFullyQualifiedType to check a single entry, shareable with derived classes. | |
IterationAction | ProcessTypeDIEMatchQuery (TypeQuery &query, DWARFDIE die, llvm::function_ref< IterationAction(DWARFDIE die)> callback) |
Check if the type die can meet the requirements of query. | |
IterationAction | ProcessNamespaceDieMatchParents (const CompilerDeclContext &parent_decl_ctx, DWARFDIE die, llvm::function_ref< IterationAction(DWARFDIE die)> callback) |
Protected Attributes inherited from lldb_private::plugin::dwarf::DWARFIndex | |
Module & | m_module |
StatsDuration | m_index_time |
Definition at line 22 of file DebugNamesDWARFIndex.h.
|
private |
Definition at line 94 of file DebugNamesDWARFIndex.h.
|
inlineprivate |
Definition at line 76 of file DebugNamesDWARFIndex.h.
References lldb_private::DebugInfo, lldb_private::plugin::dwarf::DWARFIndex::DWARFIndex(), GetTypeUnitSignatures(), GetUnits(), m_debug_info, m_debug_names_data, m_debug_names_up, m_debug_str_data, and m_fallback.
Referenced by Create().
|
static |
Definition at line 27 of file DebugNamesDWARFIndex.cpp.
References DebugNamesDWARFIndex(), lldb_private::DWARFDataExtractor::GetAsLLVM(), and lldb_private::DWARFDataExtractor::GetAsLLVMDWARF().
Referenced by lldb_private::plugin::dwarf::SymbolFileDWARF::InitializeObject().
|
overridevirtual |
Implements lldb_private::plugin::dwarf::DWARFIndex.
Definition at line 663 of file DebugNamesDWARFIndex.cpp.
References m_debug_names_up, m_fallback, and lldb_private::Stream::PutCString().
|
overridevirtual |
Implements lldb_private::plugin::dwarf::DWARFIndex.
Definition at line 258 of file DebugNamesDWARFIndex.cpp.
References lldb_private::plugin::dwarf::DWARFBaseDIE::GetAttributeValueAsUnsigned(), GetDIE(), lldb_private::ConstString::GetStringRef(), m_debug_names_up, m_fallback, and lldb_private::Stop.
|
private |
Definition at line 140 of file DebugNamesDWARFIndex.cpp.
References lldb_private::plugin::dwarf::DWARFUnit::GetDIE(), GetNonSkeletonUnit(), lldb_private::plugin::dwarf::DWARFUnit::GetOffset(), and lldb_private::plugin::dwarf::DWARFIndex::m_module.
Referenced by GetCompleteObjCClass(), GetFunctions(), and ProcessEntry().
|
private |
Checks if an entry is a foreign TU and fetch the type unit.
This function checks if the DebugNames::Entry refers to a foreign TU and returns an optional with a value of the entry is a foreign type unit entry. A valid pointer will be returned if this entry is from a .dwo file or if it is from a .dwp file and it matches the type unit's originating .dwo file by verifying that the DW_TAG_type_unit DIE has a DW_AT_dwo_name that matches the DWO name from the originating skeleton compile unit.
[in] | entry | The accelerator table entry to check. |
Definition at line 65 of file DebugNamesDWARFIndex.cpp.
References lldb_private::plugin::dwarf::DIERef::DebugInfo, lldb_private::plugin::dwarf::SymbolFileDWARF::DebugInfo(), lldb_private::plugin::dwarf::DWARFBaseDIE::GetAttributeValueAsString(), lldb_private::plugin::dwarf::DWARFUnit::GetNonSkeletonUnit(), lldb_private::plugin::dwarf::DWARFUnit::GetSymbolFileDWARF(), lldb_private::plugin::dwarf::DWARFDebugInfo::GetTypeUnitForHash(), lldb_private::plugin::dwarf::DWARFUnit::GetUnitDIEOnly(), lldb_private::plugin::dwarf::DWARFUnit::IsDWOUnit(), and m_debug_info.
Referenced by GetFullyQualifiedType(), GetNonSkeletonUnit(), and GetTypesWithQuery().
|
overridevirtual |
Uses DWARF5's IDX_parent fields, when available, to speed up this query.
Reimplemented from lldb_private::plugin::dwarf::DWARFIndex.
Definition at line 330 of file DebugNamesDWARFIndex.cpp.
References GetForeignTypeUnit(), lldb_private::plugin::dwarf::DWARFIndex::GetFullyQualifiedTypeImpl(), lldb_private::plugin::dwarf::DWARFDeclContext::GetSize(), m_debug_names_up, m_fallback, ProcessEntry(), SameParentChain(), and lldb_private::Stop.
|
overridevirtual |
Implements lldb_private::plugin::dwarf::DWARFIndex.
Definition at line 612 of file DebugNamesDWARFIndex.cpp.
References lldb_private::Continue, GetDIE(), lldb_private::plugin::dwarf::DWARFDIE::GetDIE(), lldb_private::Module::LookupInfo::GetLookupName(), lldb_private::ConstString::GetStringRef(), m_debug_names_up, m_fallback, lldb_private::plugin::dwarf::DWARFIndex::ProcessFunctionDIE(), and lldb_private::Stop.
|
overridevirtual |
Implements lldb_private::plugin::dwarf::DWARFIndex.
Definition at line 638 of file DebugNamesDWARFIndex.cpp.
References lldb_private::RegularExpression::Execute(), m_debug_names_up, m_fallback, MaybeLogLookupError(), ProcessEntry(), and lldb_private::Stop.
|
overridevirtual |
Implements lldb_private::plugin::dwarf::DWARFIndex.
Definition at line 195 of file DebugNamesDWARFIndex.cpp.
References m_debug_names_up, m_fallback, MaybeLogLookupError(), lldb_private::Mangled::NameMatches(), ProcessEntry(), and lldb_private::Stop.
|
overridevirtual |
Finds global variables with the given base name.
Any additional filtering (e.g., to only retrieve variables from a given context) should be done by the consumer.
Implements lldb_private::plugin::dwarf::DWARFIndex.
Definition at line 180 of file DebugNamesDWARFIndex.cpp.
References lldb_private::ConstString::GetStringRef(), m_debug_names_up, m_fallback, ProcessEntry(), and lldb_private::Stop.
|
overridevirtual |
cu must be the skeleton unit if possible, not GetNonSkeletonUnit().
Implements lldb_private::plugin::dwarf::DWARFIndex.
Definition at line 220 of file DebugNamesDWARFIndex.cpp.
References lldb_private::plugin::dwarf::DWARFUnit::GetOffset(), m_debug_names_up, m_fallback, MaybeLogLookupError(), ProcessEntry(), and lldb_private::Stop.
|
overridevirtual |
Implements lldb_private::plugin::dwarf::DWARFIndex.
Definition at line 486 of file DebugNamesDWARFIndex.cpp.
References lldb_private::ConstString::GetStringRef(), m_debug_names_up, m_fallback, ProcessEntry(), and lldb_private::Stop.
|
overridevirtual |
Get namespace DIEs whose base name match.
name | with |
parent_decl_ctx | in its decl parent chain. A base implementation is provided. Specializations should override this if they are able to provide a faster implementation. |
Reimplemented from lldb_private::plugin::dwarf::DWARFIndex.
Definition at line 571 of file DebugNamesDWARFIndex.cpp.
References lldb_private::CompilerDeclContext::GetCompilerContext(), lldb_private::ConstString::GetStringRef(), m_debug_names_up, m_fallback, ProcessEntry(), lldb_private::plugin::dwarf::DWARFIndex::ProcessNamespaceDieMatchParents(), lldb_private::Stop, and WithinParentChain().
|
private |
Definition at line 122 of file DebugNamesDWARFIndex.cpp.
References lldb_private::plugin::dwarf::DIERef::DebugInfo, GetForeignTypeUnit(), and m_debug_info.
Referenced by GetDIE(), SameAsEntryContext(), and SameParentChain().
|
inlineoverridevirtual |
Implements lldb_private::plugin::dwarf::DWARFIndex.
Definition at line 39 of file DebugNamesDWARFIndex.h.
|
private |
Definition at line 503 of file DebugNamesDWARFIndex.cpp.
References lldb_private::AnyType, lldb_private::TypeQuery::GetContextRef(), and lldb_private::Invalid.
Referenced by GetTypesWithQuery().
|
overridevirtual |
Implements lldb_private::plugin::dwarf::DWARFIndex.
Definition at line 472 of file DebugNamesDWARFIndex.cpp.
References m_debug_names_up, m_fallback, ProcessEntry(), and lldb_private::Stop.
|
overridevirtual |
Implements lldb_private::plugin::dwarf::DWARFIndex.
Definition at line 458 of file DebugNamesDWARFIndex.cpp.
References lldb_private::ConstString::GetStringRef(), m_debug_names_up, m_fallback, ProcessEntry(), and lldb_private::Stop.
Referenced by GetTypesWithQuery().
|
overridevirtual |
Get type DIEs meeting requires of query.
in its decl parent chain as subset. A base implementation is provided, Specializations should override this if they are able to provide a faster implementation.
Reimplemented from lldb_private::plugin::dwarf::DWARFIndex.
Definition at line 524 of file DebugNamesDWARFIndex.cpp.
References lldb_private::TypeQuery::GetContextRef(), lldb_private::TypeQuery::GetExactMatch(), GetForeignTypeUnit(), lldb_private::TypeQuery::GetTypeBasename(), GetTypeQueryParentContexts(), GetTypes(), m_debug_names_up, m_fallback, ProcessEntry(), lldb_private::plugin::dwarf::DWARFIndex::ProcessTypeDIEMatchQuery(), lldb_private::Stop, and WithinParentChain().
|
staticprivate |
Definition at line 40 of file DebugNamesDWARFIndex.cpp.
Referenced by DebugNamesDWARFIndex().
|
staticprivate |
Definition at line 51 of file DebugNamesDWARFIndex.cpp.
Referenced by DebugNamesDWARFIndex().
|
staticprivate |
Definition at line 169 of file DebugNamesDWARFIndex.cpp.
References error(), lldb_private::GetLog(), LLDB_LOG_ERROR, and lldb_private::Lookups.
Referenced by GetFunctions(), GetGlobalVariables(), and GetGlobalVariables().
|
inlineoverridevirtual |
Implements lldb_private::plugin::dwarf::DWARFIndex.
Definition at line 28 of file DebugNamesDWARFIndex.h.
References m_fallback.
|
private |
Definition at line 155 of file DebugNamesDWARFIndex.cpp.
References lldb_private::Continue, lldb_private::plugin::dwarf::DWARFBaseDIE::GetAttributeValueAsUnsigned(), GetDIE(), and lldb_private::plugin::dwarf::DWARFDIE::IsStructUnionOrClass().
Referenced by GetFullyQualifiedType(), GetFunctions(), GetGlobalVariables(), GetGlobalVariables(), GetGlobalVariables(), GetNamespaces(), GetNamespacesWithParents(), GetTypes(), GetTypes(), and GetTypesWithQuery().
|
private |
Returns true if .debug_names pool entry entry
matches query_context
.
Definition at line 376 of file DebugNamesDWARFIndex.cpp.
References GetNonSkeletonUnit(), lldb_private::plugin::dwarf::DWARFUnit::GetOffset(), lldb_private::CompilerContext::name, and lldb_private::plugin::dwarf::DWARFUnit::PeekDIEName().
Referenced by SameParentChain(), and WithinParentChain().
|
private |
Definition at line 419 of file DebugNamesDWARFIndex.cpp.
References SameAsEntryContext().
|
private |
Returns true if parent_entries have identical names to parent_names.
Definition at line 391 of file DebugNamesDWARFIndex.cpp.
References GetNonSkeletonUnit(), lldb_private::plugin::dwarf::DWARFUnit::GetOffset(), and lldb_private::plugin::dwarf::DWARFUnit::PeekDIEName().
Referenced by GetFullyQualifiedType(), and WithinParentChain().
|
private |
Returns true if parent_contexts entries are within parent_chain.
This is diffferent from SameParentChain() which checks for exact match. This function is required because parent_chain can contain inline namespace entries which may not be specified in parent_contexts by client.
[in] | parent_contexts | The list of parent contexts to check for. |
[in] | parent_chain | The fully qualified parent chain entries from .debug_names index table to check against. |
Definition at line 434 of file DebugNamesDWARFIndex.cpp.
References SameAsEntryContext(), and SameParentChain().
Referenced by GetNamespacesWithParents(), and GetTypesWithQuery().
|
private |
Definition at line 87 of file DebugNamesDWARFIndex.h.
Referenced by DebugNamesDWARFIndex(), GetForeignTypeUnit(), and GetNonSkeletonUnit().
|
private |
Definition at line 91 of file DebugNamesDWARFIndex.h.
Referenced by DebugNamesDWARFIndex().
|
private |
Definition at line 95 of file DebugNamesDWARFIndex.h.
Referenced by DebugNamesDWARFIndex(), Dump(), GetCompleteObjCClass(), GetFullyQualifiedType(), GetFunctions(), GetFunctions(), GetGlobalVariables(), GetGlobalVariables(), GetGlobalVariables(), GetNamespaces(), GetNamespacesWithParents(), GetTypes(), GetTypes(), and GetTypesWithQuery().
|
private |
Definition at line 92 of file DebugNamesDWARFIndex.h.
Referenced by DebugNamesDWARFIndex().
|
private |
Definition at line 96 of file DebugNamesDWARFIndex.h.
Referenced by DebugNamesDWARFIndex(), Dump(), GetCompleteObjCClass(), GetFullyQualifiedType(), GetFunctions(), GetFunctions(), GetGlobalVariables(), GetGlobalVariables(), GetGlobalVariables(), GetNamespaces(), GetNamespacesWithParents(), GetTypes(), GetTypes(), GetTypesWithQuery(), and Preload().