diff options
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h')
-rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h | 55 |
1 files changed, 34 insertions, 21 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h b/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h index dca25496373f..5d041c36c8f2 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h @@ -6,12 +6,13 @@ // //===----------------------------------------------------------------------===// -#ifndef LLDB_DEBUGNAMESDWARFINDEX_H -#define LLDB_DEBUGNAMESDWARFINDEX_H +#ifndef LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DEBUGNAMESDWARFINDEX_H +#define LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DEBUGNAMESDWARFINDEX_H #include "Plugins/SymbolFile/DWARF/DWARFIndex.h" #include "Plugins/SymbolFile/DWARF/LogChannelDWARF.h" #include "Plugins/SymbolFile/DWARF/ManualDWARFIndex.h" +#include "Plugins/SymbolFile/DWARF/SymbolFileDWARF.h" #include "lldb/Utility/ConstString.h" #include "llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h" @@ -20,28 +21,38 @@ class DebugNamesDWARFIndex : public DWARFIndex { public: static llvm::Expected<std::unique_ptr<DebugNamesDWARFIndex>> Create(Module &module, DWARFDataExtractor debug_names, - DWARFDataExtractor debug_str, DWARFDebugInfo *debug_info); + DWARFDataExtractor debug_str, SymbolFileDWARF &dwarf); void Preload() override { m_fallback.Preload(); } - void GetGlobalVariables(ConstString basename, DIEArray &offsets) override; - void GetGlobalVariables(const RegularExpression ®ex, - DIEArray &offsets) override; - void GetGlobalVariables(const DWARFUnit &cu, DIEArray &offsets) override; - void GetObjCMethods(ConstString class_name, DIEArray &offsets) override {} - void GetCompleteObjCClass(ConstString class_name, bool must_be_implementation, - DIEArray &offsets) override; - void GetTypes(ConstString name, DIEArray &offsets) override; - void GetTypes(const DWARFDeclContext &context, DIEArray &offsets) override; - void GetNamespaces(ConstString name, DIEArray &offsets) override; + void + GetGlobalVariables(ConstString basename, + llvm::function_ref<bool(DWARFDIE die)> callback) override; + void + GetGlobalVariables(const RegularExpression ®ex, + llvm::function_ref<bool(DWARFDIE die)> callback) override; + void + GetGlobalVariables(const DWARFUnit &cu, + llvm::function_ref<bool(DWARFDIE die)> callback) override; + 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(ConstString name, SymbolFileDWARF &dwarf, const CompilerDeclContext &parent_decl_ctx, uint32_t name_type_mask, - std::vector<DWARFDIE> &dies) override; + llvm::function_ref<bool(DWARFDIE die)> callback) override; void GetFunctions(const RegularExpression ®ex, - DIEArray &offsets) override; + llvm::function_ref<bool(DWARFDIE die)> callback) override; - void ReportInvalidDIERef(const DIERef &ref, llvm::StringRef name) override {} void Dump(Stream &s) override; private: @@ -49,11 +60,11 @@ private: std::unique_ptr<llvm::DWARFDebugNames> debug_names_up, DWARFDataExtractor debug_names_data, DWARFDataExtractor debug_str_data, - DWARFDebugInfo &debug_info) - : DWARFIndex(module), m_debug_info(debug_info), + SymbolFileDWARF &dwarf) + : DWARFIndex(module), m_debug_info(dwarf.DebugInfo()), m_debug_names_data(debug_names_data), m_debug_str_data(debug_str_data), m_debug_names_up(std::move(debug_names_up)), - m_fallback(module, &debug_info, GetUnits(*m_debug_names_up)) {} + m_fallback(module, dwarf, GetUnits(*m_debug_names_up)) {} DWARFDebugInfo &m_debug_info; @@ -67,7 +78,9 @@ private: ManualDWARFIndex m_fallback; llvm::Optional<DIERef> ToDIERef(const DebugNames::Entry &entry); - void Append(const DebugNames::Entry &entry, DIEArray &offsets); + bool ProcessEntry(const DebugNames::Entry &entry, + llvm::function_ref<bool(DWARFDIE die)> callback, + llvm::StringRef name); static void MaybeLogLookupError(llvm::Error error, const DebugNames::NameIndex &ni, @@ -78,4 +91,4 @@ private: } // namespace lldb_private -#endif // LLDB_DEBUGNAMESDWARFINDEX_H +#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DEBUGNAMESDWARFINDEX_H |