LLDB mainline
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
lldb_private::plugin::dwarf::AppleDWARFIndex Class Reference

#include <AppleDWARFIndex.h>

Inheritance diagram for lldb_private::plugin::dwarf::AppleDWARFIndex:
Inheritance graph
[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< bool(DWARFDIE die)> callback) override
 Finds global variables with the given base name.
 
void GetGlobalVariables (const RegularExpression &regex, llvm::function_ref< bool(DWARFDIE die)> callback) override
 
void GetGlobalVariables (DWARFUnit &cu, llvm::function_ref< bool(DWARFDIE die)> callback) override
 cu must be the skeleton unit if possible, not GetNonSkeletonUnit().
 
void GetObjCMethods (ConstString class_name, llvm::function_ref< bool(DWARFDIE die)> callback) override
 
void GetCompleteObjCClass (ConstString class_name, bool must_be_implementation, llvm::function_ref< bool(DWARFDIE die)> callback) override
 
void GetTypes (ConstString name, llvm::function_ref< bool(DWARFDIE die)> callback) override
 
void GetTypes (const DWARFDeclContext &context, llvm::function_ref< bool(DWARFDIE die)> callback) override
 
void GetNamespaces (ConstString name, llvm::function_ref< bool(DWARFDIE die)> callback) override
 
void GetFunctions (const Module::LookupInfo &lookup_info, SymbolFileDWARF &dwarf, const CompilerDeclContext &parent_decl_ctx, llvm::function_ref< bool(DWARFDIE die)> callback) override
 
void GetFunctions (const RegularExpression &regex, llvm::function_ref< bool(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 Preload ()=0
 
virtual void GetGlobalVariables (ConstString basename, llvm::function_ref< bool(DWARFDIE die)> callback)=0
 Finds global variables with the given base name.
 
virtual void GetGlobalVariables (const RegularExpression &regex, llvm::function_ref< bool(DWARFDIE die)> callback)=0
 
virtual void GetGlobalVariables (DWARFUnit &cu, llvm::function_ref< bool(DWARFDIE die)> callback)=0
 cu must be the skeleton unit if possible, not GetNonSkeletonUnit().
 
virtual void GetObjCMethods (ConstString class_name, llvm::function_ref< bool(DWARFDIE die)> callback)=0
 
virtual void GetCompleteObjCClass (ConstString class_name, bool must_be_implementation, llvm::function_ref< bool(DWARFDIE die)> callback)=0
 
virtual void GetTypes (ConstString name, llvm::function_ref< bool(DWARFDIE die)> callback)=0
 
virtual void GetTypes (const DWARFDeclContext &context, llvm::function_ref< bool(DWARFDIE die)> callback)=0
 
virtual void GetFullyQualifiedType (const DWARFDeclContext &context, llvm::function_ref< bool(DWARFDIE die)> callback)
 Finds all DIEs whose fully qualified name matches context.
 
virtual void GetNamespaces (ConstString name, llvm::function_ref< bool(DWARFDIE die)> callback)=0
 
virtual void GetTypesWithQuery (TypeQuery &query, llvm::function_ref< bool(DWARFDIE die)> callback)
 Get type DIEs meeting requires of query.
 
virtual void GetNamespacesWithParents (ConstString name, const CompilerDeclContext &parent_decl_ctx, llvm::function_ref< bool(DWARFDIE die)> callback)
 Get namespace DIEs whose base name match.
 
virtual void GetFunctions (const Module::LookupInfo &lookup_info, SymbolFileDWARF &dwarf, const CompilerDeclContext &parent_decl_ctx, llvm::function_ref< bool(DWARFDIE die)> callback)=0
 
virtual void GetFunctions (const RegularExpression &regex, llvm::function_ref< bool(DWARFDIE die)> callback)=0
 
virtual void Dump (Stream &s)=0
 
StatsDuration::Duration GetIndexTime ()
 
void ResetStatistics ()
 

Static Public Member Functions

static std::unique_ptr< AppleDWARFIndexCreate (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< bool(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
bool ProcessFunctionDIE (const Module::LookupInfo &lookup_info, DWARFDIE die, const CompilerDeclContext &parent_decl_ctx, llvm::function_ref< bool(DWARFDIE die)> callback)
 Helper function implementing common logic for processing function dies.
 
DIERefCallbackImpl DIERefCallback (llvm::function_ref< bool(DWARFDIE die)> callback, llvm::StringRef name={}) const
 
void ReportInvalidDIERef (DIERef ref, llvm::StringRef name) const
 
bool GetFullyQualifiedTypeImpl (const DWARFDeclContext &context, DWARFDIE die, llvm::function_ref< bool(DWARFDIE die)> callback)
 Implementation of GetFullyQualifiedType to check a single entry, shareable with derived classes.
 
bool ProcessTypeDIEMatchQuery (TypeQuery &query, DWARFDIE die, llvm::function_ref< bool(DWARFDIE die)> callback)
 Check if the type die can meet the requirements of query.
 
bool ProcessNamespaceDieMatchParents (const CompilerDeclContext &parent_decl_ctx, DWARFDIE die, llvm::function_ref< bool(DWARFDIE die)> callback)
 
- Protected Attributes inherited from lldb_private::plugin::dwarf::DWARFIndex
Modulem_module
 
StatsDuration m_index_time
 

Detailed Description

Definition at line 17 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

Definition at line 24 of file AppleDWARFIndex.h.

Member Function Documentation

◆ Create()

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

◆ Dump()

void AppleDWARFIndex::Dump ( Stream s)
overridevirtual

◆ GetCompleteObjCClass()

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

◆ GetFunctions() [1/2]

void AppleDWARFIndex::GetFunctions ( const Module::LookupInfo lookup_info,
SymbolFileDWARF dwarf,
const CompilerDeclContext parent_decl_ctx,
llvm::function_ref< bool(DWARFDIE die)>  callback 
)
overridevirtual

◆ GetFunctions() [2/2]

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

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

Definition at line 297 of file AppleDWARFIndex.cpp.

References GetGlobalVariables().

◆ GetGlobalVariables() [1/3]

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

◆ GetGlobalVariables() [2/3]

void AppleDWARFIndex::GetGlobalVariables ( ConstString  basename,
llvm::function_ref< bool(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 137 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< bool(DWARFDIE die)>  callback 
)
overridevirtual

◆ GetNamespaces()

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

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

Definition at line 269 of file AppleDWARFIndex.cpp.

References m_apple_namespaces_up, and SearchFor().

◆ GetObjCMethods()

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

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

Definition at line 179 of file AppleDWARFIndex.cpp.

References m_apple_objc_up, and SearchFor().

◆ GetTypes() [1/2]

void AppleDWARFIndex::GetTypes ( const DWARFDeclContext context,
llvm::function_ref< bool(DWARFDIE die)>  callback 
)
overridevirtual

◆ GetTypes() [2/2]

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

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

Definition at line 212 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 42 of file AppleDWARFIndex.h.

◆ SearchFor()

void AppleDWARFIndex::SearchFor ( const llvm::AppleAcceleratorTable &  table,
llvm::StringRef  name,
llvm::function_ref< bool(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 false for an entry, the search is interrupted.

Definition at line 120 of file AppleDWARFIndex.cpp.

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

Referenced by GetGlobalVariables(), GetNamespaces(), GetObjCMethods(), 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 81 of file AppleDWARFIndex.h.

◆ m_apple_names_up

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

Definition at line 74 of file AppleDWARFIndex.h.

Referenced by Dump(), GetFunctions(), GetGlobalVariables(), and GetTypes().

◆ m_apple_namespaces_storage

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

Definition at line 82 of file AppleDWARFIndex.h.

◆ m_apple_namespaces_up

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

Definition at line 75 of file AppleDWARFIndex.h.

Referenced by Dump(), and GetNamespaces().

◆ m_apple_objc_storage

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

Definition at line 84 of file AppleDWARFIndex.h.

◆ m_apple_objc_up

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

Definition at line 77 of file AppleDWARFIndex.h.

Referenced by Dump(), and GetObjCMethods().

◆ m_apple_types_storage

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

Definition at line 83 of file AppleDWARFIndex.h.

◆ m_apple_types_up

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

Definition at line 76 of file AppleDWARFIndex.h.

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


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