LLDB mainline
lldb_private::plugin::dwarf::AppleDWARFIndex Class Reference

#include <AppleDWARFIndex.h>

Inheritance diagram for lldb_private::plugin::dwarf::AppleDWARFIndex:
[legend]

Public Member Functions

 AppleDWARFIndex (Module &module, std::unique_ptr< llvm::AppleAcceleratorTable > apple_names, std::unique_ptr< llvm::AppleAcceleratorTable > apple_namespaces, std::unique_ptr< llvm::AppleAcceleratorTable > apple_types, std::unique_ptr< llvm::AppleAcceleratorTable > apple_objc, lldb::DataBufferSP apple_names_storage, lldb::DataBufferSP apple_namespaces_storage, lldb::DataBufferSP apple_types_storage, lldb::DataBufferSP apple_objc_storage)
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 &regex, 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 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 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 &regex, 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 ()
virtual void GetFullyQualifiedType (const DWARFDeclContext &context, llvm::function_ref< IterationAction(DWARFDIE die)> callback)
 Finds all DIEs whose fully qualified name matches context.
virtual void GetTypesWithQuery (TypeQuery &query, llvm::function_ref< IterationAction(DWARFDIE die)> callback)
 Get type DIEs meeting requires of query.
virtual void GetNamespacesWithParents (ConstString name, const CompilerDeclContext &parent_decl_ctx, llvm::function_ref< IterationAction(DWARFDIE die)> callback)
 Get namespace DIEs whose base name match.
virtual void GetFunctions (const std::vector< Module::LookupInfo > &lookup_infos, SymbolFileDWARF &dwarf, const CompilerDeclContext &parent_decl_ctx, llvm::function_ref< IterationAction(DWARFDIE die)> callback)
virtual StatsDuration::Duration GetIndexTime ()
 Time spent creating this index and any index it falls back to, including loading them from or saving them to the index cache.
virtual void ResetStatistics ()

Static Public Member Functions

static std::unique_ptr< AppleDWARFIndex > Create (Module &module, DWARFDataExtractor apple_names, DWARFDataExtractor apple_namespaces, DWARFDataExtractor apple_types, DWARFDataExtractor apple_objc, DWARFDataExtractor debug_str)

Private Member Functions

void SearchFor (const llvm::AppleAcceleratorTable &table, llvm::StringRef name, llvm::function_ref< IterationAction(DWARFDIE die)> callback, std::optional< dw_tag_t > search_for_tag=std::nullopt, std::optional< uint32_t > search_for_qualhash=std::nullopt)
 }

Private Attributes

std::unique_ptr< llvm::AppleAcceleratorTable > m_apple_names_up
std::unique_ptr< llvm::AppleAcceleratorTable > m_apple_namespaces_up
std::unique_ptr< llvm::AppleAcceleratorTable > m_apple_types_up
std::unique_ptr< llvm::AppleAcceleratorTable > m_apple_objc_up
lldb::DataBufferSP m_apple_names_storage
 The following storage variables hold the data that the apple accelerator tables tables above point to.
lldb::DataBufferSP m_apple_namespaces_storage
lldb::DataBufferSP m_apple_types_storage
lldb::DataBufferSP m_apple_objc_storage

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

Detailed Description

Definition at line 18 of file AppleDWARFIndex.h.

Constructor & Destructor Documentation

◆ AppleDWARFIndex()

lldb_private::plugin::dwarf::AppleDWARFIndex::AppleDWARFIndex ( Module & module,
std::unique_ptr< llvm::AppleAcceleratorTable > apple_names,
std::unique_ptr< llvm::AppleAcceleratorTable > apple_namespaces,
std::unique_ptr< llvm::AppleAcceleratorTable > apple_types,
std::unique_ptr< llvm::AppleAcceleratorTable > apple_objc,
lldb::DataBufferSP apple_names_storage,
lldb::DataBufferSP apple_namespaces_storage,
lldb::DataBufferSP apple_types_storage,
lldb::DataBufferSP apple_objc_storage )
inline

Member Function Documentation

◆ Create()

◆ Dump()

void AppleDWARFIndex::Dump ( Stream & s)
overridevirtual

◆ GetCompleteObjCClass()

void AppleDWARFIndex::GetCompleteObjCClass ( ConstString class_name,
bool must_be_implementation,
llvm::function_ref< IterationAction(DWARFDIE die)> callback )
overridevirtual

◆ GetFunctions() [1/2]

◆ GetFunctions() [2/2]

void AppleDWARFIndex::GetFunctions ( const RegularExpression & regex,
llvm::function_ref< IterationAction(DWARFDIE die)> callback )
overridevirtual

Implements lldb_private::plugin::dwarf::DWARFIndex.

Definition at line 302 of file AppleDWARFIndex.cpp.

References GetGlobalVariables().

◆ GetGlobalVariables() [1/3]

void AppleDWARFIndex::GetGlobalVariables ( const RegularExpression & regex,
llvm::function_ref< IterationAction(DWARFDIE die)> callback )
overridevirtual

◆ GetGlobalVariables() [2/3]

void AppleDWARFIndex::GetGlobalVariables ( ConstString basename,
llvm::function_ref< IterationAction(DWARFDIE die)> callback )
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 138 of file AppleDWARFIndex.cpp.

References m_apple_names_up, and SearchFor().

Referenced by GetFunctions().

◆ GetGlobalVariables() [3/3]

void AppleDWARFIndex::GetGlobalVariables ( DWARFUnit & cu,
llvm::function_ref< IterationAction(DWARFDIE die)> callback )
overridevirtual

◆ GetNamespaces()

void AppleDWARFIndex::GetNamespaces ( ConstString name,
llvm::function_ref< IterationAction(DWARFDIE die)> callback )
overridevirtual

Implements lldb_private::plugin::dwarf::DWARFIndex.

Definition at line 272 of file AppleDWARFIndex.cpp.

References m_apple_namespaces_up, and SearchFor().

◆ GetObjCMethods()

void AppleDWARFIndex::GetObjCMethods ( ConstString class_name,
llvm::function_ref< IterationAction(DWARFDIE die)> callback )
overridevirtual

Implements lldb_private::plugin::dwarf::DWARFIndex.

Definition at line 181 of file AppleDWARFIndex.cpp.

References m_apple_objc_up, and SearchFor().

◆ GetTypes() [1/2]

◆ GetTypes() [2/2]

void AppleDWARFIndex::GetTypes ( ConstString name,
llvm::function_ref< IterationAction(DWARFDIE die)> callback )
overridevirtual

Implements lldb_private::plugin::dwarf::DWARFIndex.

Definition at line 215 of file AppleDWARFIndex.cpp.

References m_apple_types_up, and SearchFor().

◆ Preload()

void lldb_private::plugin::dwarf::AppleDWARFIndex::Preload ( )
inlineoverridevirtual

Implements lldb_private::plugin::dwarf::DWARFIndex.

Definition at line 43 of file AppleDWARFIndex.h.

◆ SearchFor()

void AppleDWARFIndex::SearchFor ( const llvm::AppleAcceleratorTable & table,
llvm::StringRef name,
llvm::function_ref< IterationAction(DWARFDIE die)> callback,
std::optional< dw_tag_t > search_for_tag = std::nullopt,
std::optional< uint32_t > search_for_qualhash = std::nullopt )
private

}

Search for entries whose name is name in table, calling callback for each match. If search_for_tag is provided, ignore entries whose tag is not search_for_tag. If search_for_qualhash is provided, ignore entries whose qualified name hash does not match search_for_qualhash. If callback returns IterationAction::Stop for an entry, the search is interrupted.

Definition at line 121 of file AppleDWARFIndex.cpp.

References lldb_private::plugin::dwarf::DWARFIndex::DIERefCallback(), EntryHasMatchingQualhash(), EntryHasMatchingTag(), and lldb_private::Stop.

Referenced by GetGlobalVariables(), GetNamespaces(), GetObjCMethods(), GetTypes(), and GetTypes().

Member Data Documentation

◆ m_apple_names_storage

lldb::DataBufferSP lldb_private::plugin::dwarf::AppleDWARFIndex::m_apple_names_storage
private

The following storage variables hold the data that the apple accelerator tables tables above point to.

{

Definition at line 87 of file AppleDWARFIndex.h.

Referenced by AppleDWARFIndex().

◆ m_apple_names_up

std::unique_ptr<llvm::AppleAcceleratorTable> lldb_private::plugin::dwarf::AppleDWARFIndex::m_apple_names_up
private

◆ m_apple_namespaces_storage

lldb::DataBufferSP lldb_private::plugin::dwarf::AppleDWARFIndex::m_apple_namespaces_storage
private

Definition at line 88 of file AppleDWARFIndex.h.

Referenced by AppleDWARFIndex().

◆ m_apple_namespaces_up

std::unique_ptr<llvm::AppleAcceleratorTable> lldb_private::plugin::dwarf::AppleDWARFIndex::m_apple_namespaces_up
private

Definition at line 81 of file AppleDWARFIndex.h.

Referenced by AppleDWARFIndex(), Dump(), and GetNamespaces().

◆ m_apple_objc_storage

lldb::DataBufferSP lldb_private::plugin::dwarf::AppleDWARFIndex::m_apple_objc_storage
private

Definition at line 90 of file AppleDWARFIndex.h.

Referenced by AppleDWARFIndex().

◆ m_apple_objc_up

std::unique_ptr<llvm::AppleAcceleratorTable> lldb_private::plugin::dwarf::AppleDWARFIndex::m_apple_objc_up
private

Definition at line 83 of file AppleDWARFIndex.h.

Referenced by AppleDWARFIndex(), Dump(), and GetObjCMethods().

◆ m_apple_types_storage

lldb::DataBufferSP lldb_private::plugin::dwarf::AppleDWARFIndex::m_apple_types_storage
private

Definition at line 89 of file AppleDWARFIndex.h.

Referenced by AppleDWARFIndex().

◆ m_apple_types_up

std::unique_ptr<llvm::AppleAcceleratorTable> lldb_private::plugin::dwarf::AppleDWARFIndex::m_apple_types_up
private

Definition at line 82 of file AppleDWARFIndex.h.

Referenced by AppleDWARFIndex(), Dump(), GetCompleteObjCClass(), GetTypes(), and GetTypes().


The documentation for this class was generated from the following files: