|
LLDB mainline
|
#include <ManualDWARFIndex.h>
Public Member Functions | |
| ManualDWARFIndex (Module &module, SymbolFileDWARF &dwarf, llvm::DenseSet< dw_offset_t > units_to_avoid={}, llvm::DenseSet< uint64_t > type_sigs_to_avoid={}) | |
| 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 &unit, 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 ®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 () |
| 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 () |
Private Member Functions | |
| void | Index () |
| Reads the DWARF debug info to build the index once. | |
| void | IndexImpl () |
| Call ManualDWARFIndex::Index() instead. | |
| bool | Decode (const DataExtractor &data, lldb::offset_t *offset_ptr) |
| 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< NameToDIE > &set) |
| bool | IsPartial () const |
| Return true if this manual DWARF index is covering only part of the DWARF. | |
Static Private Member Functions | |
| static void | IndexUnitImpl (DWARFUnit &unit, const lldb::LanguageType cu_language, IndexSet< NameToDIE > &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. | |
| llvm::DenseSet< uint64_t > | m_type_sigs_to_avoid |
| IndexSet< NameToDIE > | m_set |
| std::once_flag | m_indexed_flag |
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 23 of file ManualDWARFIndex.h.
|
inline |
Definition at line 25 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 577 of file ManualDWARFIndex.cpp.
References lldb_private::CacheSignature::Decode(), lldb_private::plugin::dwarf::DecodeIndexSet(), m_dwarf, and m_set.
Referenced by LoadFromCache().
|
overridevirtual |
Implements lldb_private::plugin::dwarf::DWARFIndex.
Definition at line 555 of file ManualDWARFIndex.cpp.
References lldb_private::Stream::Format(), lldb_private::plugin::dwarf::DWARFIndex::m_module, m_set, and lldb_private::Stream::Printf().
|
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 591 of file ManualDWARFIndex.cpp.
References lldb_private::CacheSignature::Encode(), lldb_private::plugin::dwarf::EncodeIndexSet(), 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 604 of file ManualDWARFIndex.cpp.
References lldb_private::ObjectFile::GetCacheHash(), lldb_private::ModuleChild::GetModule(), IsPartial(), and m_dwarf.
Referenced by LoadFromCache(), and SaveToCache().
|
overridevirtual |
Implements lldb_private::plugin::dwarf::DWARFIndex.
Definition at line 464 of file ManualDWARFIndex.cpp.
References lldb_private::plugin::dwarf::DWARFIndex::DIERefCallback(), lldb_private::ConstString::GetStringRef(), Index(), and m_set.
|
overridevirtual |
Implements lldb_private::plugin::dwarf::DWARFIndex.
Definition at line 495 of file ManualDWARFIndex.cpp.
References lldb_private::Continue, lldb_private::plugin::dwarf::SymbolFileDWARF::DIEInDeclContext(), lldb_private::plugin::dwarf::DWARFIndex::DIERefCallback(), lldb_private::Module::LookupInfo::GetLookupName(), lldb_private::Module::LookupInfo::GetNameTypeMask(), lldb_private::ConstString::GetStringRef(), Index(), lldb_private::CompilerDeclContext::IsValid(), and m_set.
|
overridevirtual |
Implements lldb_private::plugin::dwarf::DWARFIndex.
Definition at line 542 of file ManualDWARFIndex.cpp.
References lldb_private::plugin::dwarf::DWARFIndex::DIERefCallback(), lldb_private::RegularExpression::GetText(), Index(), and m_set.
|
overridevirtual |
Implements lldb_private::plugin::dwarf::DWARFIndex.
Definition at line 442 of file ManualDWARFIndex.cpp.
References lldb_private::plugin::dwarf::DWARFIndex::DIERefCallback(), lldb_private::RegularExpression::GetText(), 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::plugin::dwarf::DWARFIndex.
Definition at line 434 of file ManualDWARFIndex.cpp.
References lldb_private::plugin::dwarf::DWARFIndex::DIERefCallback(), lldb_private::ConstString::GetStringRef(), Index(), and m_set.
|
overridevirtual |
cu must be the skeleton unit if possible, not GetNonSkeletonUnit().
Implements lldb_private::plugin::dwarf::DWARFIndex.
Definition at line 449 of file ManualDWARFIndex.cpp.
References lldb_private::plugin::dwarf::DWARFIndex::DIERefCallback(), Index(), and m_set.
|
overridevirtual |
Implements lldb_private::plugin::dwarf::DWARFIndex.
Definition at line 488 of file ManualDWARFIndex.cpp.
References lldb_private::plugin::dwarf::DWARFIndex::DIERefCallback(), lldb_private::ConstString::GetStringRef(), Index(), and m_set.
|
overridevirtual |
Implements lldb_private::plugin::dwarf::DWARFIndex.
Definition at line 456 of file ManualDWARFIndex.cpp.
References lldb_private::plugin::dwarf::DWARFIndex::DIERefCallback(), lldb_private::ConstString::GetStringRef(), Index(), and m_set.
|
overridevirtual |
Implements lldb_private::plugin::dwarf::DWARFIndex.
Definition at line 479 of file ManualDWARFIndex.cpp.
References lldb_private::plugin::dwarf::DWARFIndex::DIERefCallback(), Index(), and m_set.
|
overridevirtual |
Implements lldb_private::plugin::dwarf::DWARFIndex.
Definition at line 472 of file ManualDWARFIndex.cpp.
References lldb_private::plugin::dwarf::DWARFIndex::DIERefCallback(), lldb_private::ConstString::GetStringRef(), Index(), and m_set.
|
private |
Reads the DWARF debug info to build the index once.
Should be called before attempting to retrieve symbols.
Definition at line 34 of file ManualDWARFIndex.cpp.
References IndexImpl(), and m_indexed_flag.
Referenced by GetCompleteObjCClass(), GetFunctions(), GetFunctions(), GetGlobalVariables(), GetGlobalVariables(), GetGlobalVariables(), GetNamespaces(), GetObjCMethods(), GetTypes(), GetTypes(), and Preload().
|
private |
Call ManualDWARFIndex::Index() instead.
Definition at line 38 of file ManualDWARFIndex.cpp.
References lldb_private::plugin::dwarf::NameToDIE::Append(), lldb_private::Stream::AsRawOstream(), lldb_private::plugin::dwarf::DWARFDebugInfo::ContainsTypeUnits(), lldb_private::plugin::dwarf::SymbolFileDWARF::DebugInfo(), lldb::eDescriptionLevelBrief, elapsed(), lldb_private::plugin::dwarf::DWARFUnit::ExtractDIEsScoped(), lldb_private::plugin::dwarf::NameToDIE::Finalize(), lldb_private::StreamString::GetData(), lldb_private::plugin::dwarf::DWARFDebugInfo::GetNumUnits(), lldb_private::plugin::dwarf::DWARFUnit::GetOffset(), lldb_private::Debugger::GetThreadPool(), lldb_private::plugin::dwarf::DWARFDebugInfo::GetUnitAtIndex(), lldb_private::Progress::Increment(), IndexUnit(), lldb_private::plugin::dwarf::IndexSet< T >::Indices(), lldb_private::Progress::kDefaultHighFrequencyReportTime, LLDB_SCOPED_TIMERF, LoadFromCache(), m_dwarf, lldb_private::plugin::dwarf::DWARFIndex::m_index_time, lldb_private::plugin::dwarf::DWARFIndex::m_module, m_set, m_type_sigs_to_avoid, m_units_to_avoid, and SaveToCache().
Referenced by Index().
|
private |
Definition at line 168 of file ManualDWARFIndex.cpp.
References lldb_private::plugin::dwarf::DWARFUnit::GetDIE(), lldb_private::plugin::dwarf::DWARFUnit::GetDWOId(), lldb_private::plugin::dwarf::DWARFUnit::GetDwoSymbolFile(), lldb_private::plugin::dwarf::DWARFDIE::GetFirstChild(), lldb_private::plugin::dwarf::DWARFUnit::GetFirstDIEOffset(), lldb_private::plugin::dwarf::SymbolFileDWARF::GetLanguage(), lldb_private::GetLog(), lldb_private::plugin::dwarf::DWARFUnit::GetNonSkeletonUnit(), lldb_private::plugin::dwarf::DWARFDebugInfo::GetNumUnits(), lldb_private::plugin::dwarf::DWARFUnit::GetOffset(), lldb_private::plugin::dwarf::DWARFDebugInfo::GetUnitAtIndex(), lldb_private::plugin::dwarf::DWARFUnit::GetVersion(), IndexUnitImpl(), lldb_private::plugin::dwarf::DWARFUnit::IsSkeletonUnit(), lldb_private::Lookups, lldb_private::plugin::dwarf::DWARFIndex::m_module, and lldb_private::plugin::dwarf::DWARFBaseDIE::Tag().
Referenced by IndexImpl().
|
staticprivate |
Definition at line 225 of file ManualDWARFIndex.cpp.
References lldb_private::plugin::dwarf::DWARFFormValue::AsCString(), lldb_private::plugin::dwarf::DWARFAttributes::AttributeAtIndex(), lldb_private::ObjCLanguage::ObjCMethodName::Create(), lldb_private::plugin::dwarf::DWARFUnit::dies(), lldb::eLanguageTypeObjC, lldb::eLanguageTypeObjC_plus_plus, lldb_private::plugin::dwarf::DWARFAttributes::ExtractFormValueAtIndex(), lldb_private::plugin::dwarf::IndexSet< T >::function_basenames, lldb_private::plugin::dwarf::IndexSet< T >::function_fullnames, lldb_private::plugin::dwarf::IndexSet< T >::function_methods, lldb_private::plugin::dwarf::IndexSet< T >::function_selectors, lldb_private::plugin::dwarf::DWARFBaseDIE::GetDIERef(), lldb_private::plugin::dwarf::DWARFUnit::GetVersion(), lldb_private::plugin::dwarf::IndexSet< T >::globals, lldb_private::plugin::dwarf::DWARFDIE::IsMethod(), lldb_private::plugin::dwarf::DWARFDIE::IsStructUnionOrClass(), lldb_private::plugin::dwarf::IndexSet< T >::namespaces, lldb_private::plugin::dwarf::IndexSet< T >::objc_class_selectors, lldb_private::plugin::dwarf::DWARFAttributes::Size(), lldb_private::plugin::dwarf::IndexSet< T >::types, and lldb_private::plugin::dwarf::DWARFFormValue::Unsigned().
Referenced by IndexUnit().
|
private |
Return true if this manual DWARF index is covering only part of the DWARF.
An instance of this class will be used to index all of the DWARF, but also when we have .debug_names we will use one to index any compile or type units that are not covered by the .debug_names table.
Definition at line 599 of file ManualDWARFIndex.cpp.
References m_type_sigs_to_avoid, and m_units_to_avoid.
Referenced by GetCacheKey().
|
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 634 of file ManualDWARFIndex.cpp.
References Decode(), lldb_private::Module::eLLDBIndexTypeDwarfIndex, lldb_private::ObjectFile::GetAddressByteSize(), lldb_private::DataFileCache::GetCachedData(), GetCacheKey(), lldb_private::Module::GetIndexCache(), lldb_private::endian::InlHostByteOrder(), m_dwarf, and lldb_private::DataFileCache::RemoveCacheFile().
Referenced by IndexImpl().
|
inlineoverridevirtual |
Implements lldb_private::plugin::dwarf::DWARFIndex.
Definition at line 32 of file ManualDWARFIndex.h.
References Index().
|
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 659 of file ManualDWARFIndex.cpp.
References lldb_private::Module::eLLDBIndexTypeDwarfIndex, Encode(), lldb_private::ObjectFile::GetAddressByteSize(), GetCacheKey(), lldb_private::DataEncoder::GetData(), lldb_private::Module::GetIndexCache(), lldb_private::endian::InlHostByteOrder(), m_dwarf, and lldb_private::DataFileCache::SetCachedData().
Referenced by IndexImpl().
|
private |
The DWARF file which we are indexing.
Definition at line 172 of file ManualDWARFIndex.h.
Referenced by Decode(), Encode(), GetCacheKey(), IndexImpl(), LoadFromCache(), and SaveToCache().
|
private |
Definition at line 178 of file ManualDWARFIndex.h.
Referenced by Index().
Definition at line 177 of file ManualDWARFIndex.h.
Referenced by Decode(), Dump(), Encode(), GetCompleteObjCClass(), GetFunctions(), GetFunctions(), GetGlobalVariables(), GetGlobalVariables(), GetGlobalVariables(), GetNamespaces(), GetObjCMethods(), GetTypes(), GetTypes(), and IndexImpl().
|
private |
Definition at line 175 of file ManualDWARFIndex.h.
Referenced by IndexImpl(), and IsPartial().
|
private |
Which dwarf units should we skip while building the index.
Definition at line 174 of file ManualDWARFIndex.h.
Referenced by IndexImpl(), and IsPartial().