LLDB mainline
|
#include <ManualDWARFIndex.h>
Classes | |
struct | IndexSet |
Public Member Functions | |
ManualDWARFIndex (Module &module, SymbolFileDWARF &dwarf, llvm::DenseSet< dw_offset_t > units_to_avoid={}) | |
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 ®ex, llvm::function_ref< bool(DWARFDIE die)> callback) override |
void | GetGlobalVariables (DWARFUnit &unit, 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 ®ex, llvm::function_ref< bool(DWARFDIE die)> callback) override |
void | Dump (Stream &s) override |
![]() | |
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 ®ex, 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 | GetNamespaces (ConstString name, llvm::function_ref< bool(DWARFDIE die)> callback)=0 |
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 ®ex, llvm::function_ref< bool(DWARFDIE die)> callback)=0 |
virtual void | Dump (Stream &s)=0 |
StatsDuration::Duration | GetIndexTime () |
Private Member Functions | |
void | Index () |
bool | Decode (const DataExtractor &data, lldb::offset_t *offset_ptr, bool &signature_mismatch) |
Decode a serialized version of this object from data. | |
bool | Encode (DataEncoder &encoder) const |
Encode this object into a data encoder object. | |
std::string | GetCacheKey () |
Get the cache key string for this symbol table. | |
void | SaveToCache () |
Save the symbol table data out into a cache. | |
bool | LoadFromCache () |
Load the symbol table from the index cache. | |
void | IndexUnit (DWARFUnit &unit, SymbolFileDWARFDwo *dwp, IndexSet &set) |
Static Private Member Functions | |
static void | IndexUnitImpl (DWARFUnit &unit, const lldb::LanguageType cu_language, IndexSet &set) |
Private Attributes | |
SymbolFileDWARF * | m_dwarf |
The DWARF file which we are indexing. | |
llvm::DenseSet< dw_offset_t > | m_units_to_avoid |
Which dwarf units should we skip while building the index. | |
IndexSet | m_set |
bool | m_indexed = false |
Additional Inherited Members | |
![]() | |
bool | ProcessFunctionDIE (const Module::LookupInfo &lookup_info, DIERef ref, SymbolFileDWARF &dwarf, 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 |
![]() | |
Module & | m_module |
StatsDuration | m_index_time |
Definition at line 20 of file ManualDWARFIndex.h.
|
inline |
Definition at line 22 of file ManualDWARFIndex.h.
|
private |
Decode a serialized version of this object from data.
data | The decoder object that references the serialized data. |
offset_ptr | A pointer that contains the offset from which the data will be decoded from that gets updated as data gets decoded. |
strtab | All strings in cache files are put into string tables for efficiency and cache file size reduction. Strings are stored as uint32_t string table offsets in the cache data. |
Definition at line 658 of file ManualDWARFIndex.cpp.
References lldb_private::CacheSignature::Decode(), lldb_private::ManualDWARFIndex::IndexSet::Decode(), lldb_private::SymbolFileCommon::GetObjectFile(), m_dwarf, and m_set.
Referenced by LoadFromCache().
|
overridevirtual |
Implements lldb_private::DWARFIndex.
Definition at line 503 of file ManualDWARFIndex.cpp.
References NameToDIE::Dump(), lldb_private::Stream::Format(), lldb_private::ManualDWARFIndex::IndexSet::function_basenames, lldb_private::ManualDWARFIndex::IndexSet::function_fullnames, lldb_private::ManualDWARFIndex::IndexSet::function_methods, lldb_private::ManualDWARFIndex::IndexSet::function_selectors, lldb_private::Module::GetArchitecture(), lldb_private::ArchSpec::GetArchitectureName(), lldb_private::ObjectFile::GetFileSpec(), lldb_private::Module::GetObjectFile(), lldb_private::ManualDWARFIndex::IndexSet::globals, lldb_private::DWARFIndex::m_module, m_set, lldb_private::ManualDWARFIndex::IndexSet::namespaces, lldb_private::ManualDWARFIndex::IndexSet::objc_class_selectors, lldb_private::Stream::Printf(), and lldb_private::ManualDWARFIndex::IndexSet::types.
Referenced by lldb_private::DebugNamesDWARFIndex::Dump().
|
private |
Encode this object into a data encoder object.
This allows this object to be serialized to disk.
encoder | A data encoder object that serialized bytes will be encoded into. |
strtab | All strings in cache files are put into string tables for efficiency and cache file size reduction. Strings are stored as uint32_t string table offsets in the cache data. |
Definition at line 676 of file ManualDWARFIndex.cpp.
References lldb_private::CacheSignature::Encode(), lldb_private::ManualDWARFIndex::IndexSet::Encode(), lldb_private::SymbolFileCommon::GetObjectFile(), m_dwarf, and m_set.
Referenced by SaveToCache().
|
private |
Get the cache key string for this symbol table.
The cache key must start with the module's cache key and is followed by information that indicates this key is for caching the symbol table contents and should also include the has of the object file. A module can be represented by an ObjectFile object for the main executable, but can also have a symbol file that is from the same or a different object file. This means we might have two symbol tables cached in the index cache, one for the main executable and one for the symbol file.
Definition at line 684 of file ManualDWARFIndex.cpp.
References lldb_private::ObjectFile::GetCacheHash(), lldb_private::ModuleChild::GetModule(), lldb_private::SymbolFileCommon::GetObjectFile(), and m_dwarf.
Referenced by LoadFromCache(), and SaveToCache().
|
overridevirtual |
Implements lldb_private::DWARFIndex.
Definition at line 414 of file ManualDWARFIndex.cpp.
References lldb_private::DWARFIndex::DIERefCallback(), NameToDIE::Find(), lldb_private::ConstString::GetStringRef(), Index(), m_set, and lldb_private::ManualDWARFIndex::IndexSet::types.
Referenced by lldb_private::DebugNamesDWARFIndex::GetCompleteObjCClass().
|
overridevirtual |
Implements lldb_private::DWARFIndex.
Definition at line 443 of file ManualDWARFIndex.cpp.
References SymbolFileDWARF::DIEInDeclContext(), lldb_private::DWARFIndex::DIERefCallback(), NameToDIE::Find(), lldb_private::ManualDWARFIndex::IndexSet::function_basenames, lldb_private::ManualDWARFIndex::IndexSet::function_fullnames, lldb_private::ManualDWARFIndex::IndexSet::function_methods, lldb_private::ManualDWARFIndex::IndexSet::function_selectors, lldb_private::Module::LookupInfo::GetLookupName(), lldb_private::Module::LookupInfo::GetNameTypeMask(), lldb_private::ConstString::GetStringRef(), Index(), lldb_private::CompilerDeclContext::IsValid(), and m_set.
Referenced by lldb_private::DebugNamesDWARFIndex::GetFunctions().
|
overridevirtual |
Implements lldb_private::DWARFIndex.
Definition at line 490 of file ManualDWARFIndex.cpp.
References lldb_private::DWARFIndex::DIERefCallback(), NameToDIE::Find(), lldb_private::ManualDWARFIndex::IndexSet::function_basenames, lldb_private::ManualDWARFIndex::IndexSet::function_fullnames, lldb_private::RegularExpression::GetText(), Index(), and m_set.
|
overridevirtual |
Implements lldb_private::DWARFIndex.
Definition at line 393 of file ManualDWARFIndex.cpp.
References lldb_private::DWARFIndex::DIERefCallback(), NameToDIE::Find(), lldb_private::RegularExpression::GetText(), lldb_private::ManualDWARFIndex::IndexSet::globals, Index(), and m_set.
|
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::DWARFIndex.
Definition at line 386 of file ManualDWARFIndex.cpp.
References lldb_private::DWARFIndex::DIERefCallback(), NameToDIE::Find(), lldb_private::ConstString::GetStringRef(), lldb_private::ManualDWARFIndex::IndexSet::globals, Index(), and m_set.
Referenced by lldb_private::DebugNamesDWARFIndex::GetGlobalVariables().
|
overridevirtual |
cu must be the skeleton unit if possible, not GetNonSkeletonUnit().
Implements lldb_private::DWARFIndex.
Definition at line 400 of file ManualDWARFIndex.cpp.
References lldb_private::DWARFIndex::DIERefCallback(), NameToDIE::FindAllEntriesForUnit(), SymbolFileDWARF::GetDwoNum(), DWARFUnit::GetSymbolFileDWARF(), lldb_private::ManualDWARFIndex::IndexSet::globals, Index(), lldbassert, and m_set.
|
overridevirtual |
Implements lldb_private::DWARFIndex.
Definition at line 437 of file ManualDWARFIndex.cpp.
References lldb_private::DWARFIndex::DIERefCallback(), NameToDIE::Find(), lldb_private::ConstString::GetStringRef(), Index(), m_set, and lldb_private::ManualDWARFIndex::IndexSet::namespaces.
Referenced by lldb_private::DebugNamesDWARFIndex::GetNamespaces().
|
overridevirtual |
Implements lldb_private::DWARFIndex.
Definition at line 407 of file ManualDWARFIndex.cpp.
References lldb_private::DWARFIndex::DIERefCallback(), NameToDIE::Find(), lldb_private::ConstString::GetStringRef(), Index(), m_set, and lldb_private::ManualDWARFIndex::IndexSet::objc_class_selectors.
|
overridevirtual |
Implements lldb_private::DWARFIndex.
Definition at line 428 of file ManualDWARFIndex.cpp.
References lldb_private::DWARFIndex::DIERefCallback(), NameToDIE::Find(), Index(), m_set, and lldb_private::ManualDWARFIndex::IndexSet::types.
|
overridevirtual |
Implements lldb_private::DWARFIndex.
Definition at line 422 of file ManualDWARFIndex.cpp.
References lldb_private::DWARFIndex::DIERefCallback(), NameToDIE::Find(), lldb_private::ConstString::GetStringRef(), Index(), m_set, and lldb_private::ManualDWARFIndex::IndexSet::types.
Referenced by lldb_private::DebugNamesDWARFIndex::GetTypes().
|
private |
Definition at line 32 of file ManualDWARFIndex.cpp.
References NameToDIE::Append(), lldb_private::Stream::AsRawOstream(), DWARFDebugInfo::ContainsTypeUnits(), SymbolFileDWARF::DebugInfo(), lldb::eDescriptionLevelBrief, elapsed(), NameToDIE::Finalize(), lldb_private::ManualDWARFIndex::IndexSet::function_basenames, lldb_private::ManualDWARFIndex::IndexSet::function_fullnames, lldb_private::ManualDWARFIndex::IndexSet::function_methods, lldb_private::ManualDWARFIndex::IndexSet::function_selectors, lldb_private::StreamString::GetData(), lldb_private::Module::GetDescription(), SymbolFileDWARF::GetDwpSymbolFile(), DWARFDebugInfo::GetNumUnits(), DWARFUnit::GetOffset(), lldb_private::Debugger::GetThreadPool(), DWARFDebugInfo::GetUnitAtIndex(), lldb_private::ManualDWARFIndex::IndexSet::globals, lldb_private::Progress::Increment(), IndexUnit(), LLDB_SCOPED_TIMERF, LoadFromCache(), m_dwarf, lldb_private::DWARFIndex::m_index_time, m_indexed, lldb_private::DWARFIndex::m_module, m_set, m_units_to_avoid, lldb_private::ManualDWARFIndex::IndexSet::namespaces, lldb_private::ManualDWARFIndex::IndexSet::objc_class_selectors, SaveToCache(), lldb_private::SymbolFileCommon::SetDebugInfoIndexWasLoadedFromCache(), and lldb_private::ManualDWARFIndex::IndexSet::types.
Referenced by GetCompleteObjCClass(), GetFunctions(), GetGlobalVariables(), GetNamespaces(), GetObjCMethods(), GetTypes(), and Preload().
|
private |
Definition at line 140 of file ManualDWARFIndex.cpp.
References DWARFUnit::GetDIE(), DWARFUnit::GetDWOId(), DWARFUnit::GetDwoSymbolFile(), DWARFDIE::GetFirstChild(), DWARFUnit::GetFirstDIEOffset(), SymbolFileDWARF::GetLanguage(), lldb_private::GetLog(), DWARFUnit::GetNonSkeletonUnit(), DWARFDebugInfo::GetNumUnits(), DWARFUnit::GetOffset(), DWARFDebugInfo::GetUnitAtIndex(), DWARFUnit::GetVersion(), IndexUnitImpl(), DWARFUnit::IsSkeletonUnit(), lldb_private::Module::LogMessage(), lldb_private::Lookups, lldb_private::DWARFIndex::m_module, and DWARFBaseDIE::Tag().
Referenced by Index().
|
staticprivate |
Definition at line 197 of file ManualDWARFIndex.cpp.
References DWARFFormValue::AsCString(), DWARFAttributes::AttributeAtIndex(), DWARFUnit::dies(), lldb::eLanguageTypeObjC, lldb::eLanguageTypeObjC_plus_plus, DWARFAttributes::ExtractFormValueAtIndex(), lldb_private::ManualDWARFIndex::IndexSet::function_basenames, lldb_private::ManualDWARFIndex::IndexSet::function_fullnames, lldb_private::ManualDWARFIndex::IndexSet::function_methods, lldb_private::ManualDWARFIndex::IndexSet::function_selectors, lldb_private::ObjCLanguage::MethodName::GetClassName(), lldb_private::ObjCLanguage::MethodName::GetClassNameWithCategory(), DWARFBaseDIE::GetDIERef(), lldb_private::ObjCLanguage::MethodName::GetFullNameWithoutCategory(), lldb_private::ObjCLanguage::MethodName::GetSelector(), lldb_private::ManualDWARFIndex::IndexSet::globals, NameToDIE::Insert(), DWARFDIE::IsMethod(), lldb_private::ObjCLanguage::MethodName::IsValid(), lldb_private::ManualDWARFIndex::IndexSet::namespaces, lldb_private::ManualDWARFIndex::IndexSet::objc_class_selectors, lldb_private::ManualDWARFIndex::IndexSet::types, and DWARFFormValue::Unsigned().
Referenced by IndexUnit().
|
private |
Load the symbol table from the index cache.
Quickly load the finalized symbol table from the index cache. This saves time when the debugger starts up. The index cache file for the symbol table has the modification time set to the same time as the main module. If the cache file exists and the modification times match, we will load the symbol table from the serlized cache file.
Definition at line 697 of file ManualDWARFIndex.cpp.
References Decode(), lldb_private::ObjectFile::GetAddressByteSize(), lldb_private::DataFileCache::GetCachedData(), GetCacheKey(), lldb_private::Module::GetIndexCache(), lldb_private::SymbolFileCommon::GetObjectFile(), lldb_private::endian::InlHostByteOrder(), m_dwarf, and lldb_private::DataFileCache::RemoveCacheFile().
Referenced by Index().
|
inlineoverridevirtual |
Implements lldb_private::DWARFIndex.
Definition at line 27 of file ManualDWARFIndex.h.
References Index().
Referenced by lldb_private::DebugNamesDWARFIndex::Preload().
|
private |
Save the symbol table data out into a cache.
The symbol table will only be saved to a cache file if caching is enabled.
We cache the contents of the symbol table since symbol tables in LLDB take some time to initialize. This is due to the many sources for data that are used to create a symbol table:
Definition at line 720 of file ManualDWARFIndex.cpp.
References Encode(), lldb_private::ObjectFile::GetAddressByteSize(), GetCacheKey(), lldb_private::Module::GetIndexCache(), lldb_private::SymbolFileCommon::GetObjectFile(), lldb_private::endian::InlHostByteOrder(), m_dwarf, lldb_private::DataFileCache::SetCachedData(), and lldb_private::SymbolFileCommon::SetDebugInfoIndexWasSavedToCache().
Referenced by Index().
|
private |
The DWARF file which we are indexing.
Definition at line 169 of file ManualDWARFIndex.h.
Referenced by Decode(), Encode(), GetCacheKey(), Index(), LoadFromCache(), and SaveToCache().
|
private |
Definition at line 174 of file ManualDWARFIndex.h.
Referenced by Index().
|
private |
Definition at line 173 of file ManualDWARFIndex.h.
Referenced by Decode(), Dump(), Encode(), GetCompleteObjCClass(), GetFunctions(), GetGlobalVariables(), GetNamespaces(), GetObjCMethods(), GetTypes(), and Index().
|
private |
Which dwarf units should we skip while building the index.
Definition at line 171 of file ManualDWARFIndex.h.
Referenced by Index().