LLDB  mainline
ManualDWARFIndex.h
Go to the documentation of this file.
1 //===-- ManualDWARFIndex.h --------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_MANUALDWARFINDEX_H
10 #define LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_MANUALDWARFINDEX_H
11 
14 #include "llvm/ADT/DenseSet.h"
15 
16 class DWARFDebugInfo;
17 class SymbolFileDWARFDwo;
18 
19 namespace lldb_private {
20 class ManualDWARFIndex : public DWARFIndex {
21 public:
23  llvm::DenseSet<dw_offset_t> units_to_avoid = {})
24  : DWARFIndex(module), m_dwarf(&dwarf),
25  m_units_to_avoid(std::move(units_to_avoid)) {}
26 
27  void Preload() override { Index(); }
28 
29  void
31  llvm::function_ref<bool(DWARFDIE die)> callback) override;
32  void
34  llvm::function_ref<bool(DWARFDIE die)> callback) override;
35  void
36  GetGlobalVariables(const DWARFUnit &unit,
37  llvm::function_ref<bool(DWARFDIE die)> callback) override;
38  void GetObjCMethods(ConstString class_name,
39  llvm::function_ref<bool(DWARFDIE die)> callback) override;
41  ConstString class_name, bool must_be_implementation,
42  llvm::function_ref<bool(DWARFDIE die)> callback) override;
43  void GetTypes(ConstString name,
44  llvm::function_ref<bool(DWARFDIE die)> callback) override;
45  void GetTypes(const DWARFDeclContext &context,
46  llvm::function_ref<bool(DWARFDIE die)> callback) override;
47  void GetNamespaces(ConstString name,
48  llvm::function_ref<bool(DWARFDIE die)> callback) override;
50  const CompilerDeclContext &parent_decl_ctx,
51  uint32_t name_type_mask,
52  llvm::function_ref<bool(DWARFDIE die)> callback) override;
53  void GetFunctions(const RegularExpression &regex,
54  llvm::function_ref<bool(DWARFDIE die)> callback) override;
55 
56  void Dump(Stream &s) override;
57 
58 private:
59  struct IndexSet {
68  };
69  void Index();
71 
72  static void IndexUnitImpl(DWARFUnit &unit,
73  const lldb::LanguageType cu_language,
74  IndexSet &set);
75 
76  /// The DWARF file which we are indexing. Set to nullptr after the index is
77  /// built.
79  /// Which dwarf units should we skip while building the index.
80  llvm::DenseSet<dw_offset_t> m_units_to_avoid;
81 
83 };
84 } // namespace lldb_private
85 
86 #endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_MANUALDWARFINDEX_H
lldb_private::RegularExpression
Definition: RegularExpression.h:18
lldb_private::DWARFIndex::DWARFIndex
DWARFIndex(Module &module)
Definition: DWARFIndex.h:22
lldb_private::ManualDWARFIndex::Index
void Index()
Definition: ManualDWARFIndex.cpp:26
lldb_private::ManualDWARFIndex::GetCompleteObjCClass
void GetCompleteObjCClass(ConstString class_name, bool must_be_implementation, llvm::function_ref< bool(DWARFDIE die)> callback) override
Definition: ManualDWARFIndex.cpp:373
DWARFDebugInfo
Definition: DWARFDebugInfo.h:26
SymbolFileDWARF
Definition: SymbolFileDWARF.h:58
lldb::LanguageType
LanguageType
Programming language type.
Definition: lldb-enumerations.h:436
lldb_private::ManualDWARFIndex::IndexSet::function_selectors
NameToDIE function_selectors
Definition: ManualDWARFIndex.h:63
lldb_private::ManualDWARFIndex::IndexSet::function_basenames
NameToDIE function_basenames
Definition: ManualDWARFIndex.h:60
lldb_private::Module
Definition: Module.h:75
lldb_private::ManualDWARFIndex::IndexUnit
void IndexUnit(DWARFUnit &unit, SymbolFileDWARFDwo *dwp, IndexSet &set)
Definition: ManualDWARFIndex.cpp:129
lldb_private::Stream
Definition: Stream.h:28
DWARFDIE
Definition: DWARFDIE.h:16
lldb_private::ManualDWARFIndex::IndexSet
Definition: ManualDWARFIndex.h:59
lldb_private::DWARFIndex
Definition: DWARFIndex.h:20
DWARFUnit
Definition: DWARFUnit.h:80
lldb_private::ManualDWARFIndex::IndexSet::objc_class_selectors
NameToDIE objc_class_selectors
Definition: ManualDWARFIndex.h:64
dwarf
Definition: ABISysV_arc.cpp:61
lldb_private::ConstString
Definition: ConstString.h:40
lldb_private::ManualDWARFIndex::IndexSet::namespaces
NameToDIE namespaces
Definition: ManualDWARFIndex.h:67
lldb_private::ManualDWARFIndex::GetNamespaces
void GetNamespaces(ConstString name, llvm::function_ref< bool(DWARFDIE die)> callback) override
Definition: ManualDWARFIndex.cpp:396
lldb_private::ManualDWARFIndex::GetGlobalVariables
void GetGlobalVariables(ConstString basename, llvm::function_ref< bool(DWARFDIE die)> callback) override
Finds global variables with the given base name.
Definition: ManualDWARFIndex.cpp:346
lldb_private::ManualDWARFIndex::m_dwarf
SymbolFileDWARF * m_dwarf
The DWARF file which we are indexing.
Definition: ManualDWARFIndex.h:78
set
set(option_framework FRAMEWORK) endif() if(LLDB_ENABLE_PYTHON) get_target_property(python_bindings_dir swig_wrapper_python BINARY_DIR) set(lldb_python_wrapper $
Definition: API/CMakeLists.txt:9
lldb_private::ManualDWARFIndex::ManualDWARFIndex
ManualDWARFIndex(Module &module, SymbolFileDWARF &dwarf, llvm::DenseSet< dw_offset_t > units_to_avoid={})
Definition: ManualDWARFIndex.h:22
lldb_private::CompilerDeclContext
Represents a generic declaration context in a program.
Definition: CompilerDeclContext.h:30
lldb_private::ManualDWARFIndex::m_units_to_avoid
llvm::DenseSet< dw_offset_t > m_units_to_avoid
Which dwarf units should we skip while building the index.
Definition: ManualDWARFIndex.h:80
uint32_t
lldb_private::ManualDWARFIndex
Definition: ManualDWARFIndex.h:20
lldb_private::ManualDWARFIndex::IndexSet::function_fullnames
NameToDIE function_fullnames
Definition: ManualDWARFIndex.h:61
lldb_private::ManualDWARFIndex::Dump
void Dump(Stream &s) override
Definition: ManualDWARFIndex.cpp:460
SymbolFileDWARFDwo
Definition: SymbolFileDWARFDwo.h:14
lldb_private::ManualDWARFIndex::Preload
void Preload() override
Definition: ManualDWARFIndex.h:27
lldb_private::ManualDWARFIndex::GetTypes
void GetTypes(ConstString name, llvm::function_ref< bool(DWARFDIE die)> callback) override
Definition: ManualDWARFIndex.cpp:381
lldb_private::ManualDWARFIndex::IndexSet::types
NameToDIE types
Definition: ManualDWARFIndex.h:66
NameToDIE.h
lldb_private::ManualDWARFIndex::IndexUnitImpl
static void IndexUnitImpl(DWARFUnit &unit, const lldb::LanguageType cu_language, IndexSet &set)
Definition: ManualDWARFIndex.cpp:157
DWARFDeclContext
Definition: DWARFDeclContext.h:23
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::ManualDWARFIndex::GetFunctions
void GetFunctions(ConstString name, SymbolFileDWARF &dwarf, const CompilerDeclContext &parent_decl_ctx, uint32_t name_type_mask, llvm::function_ref< bool(DWARFDIE die)> callback) override
Definition: ManualDWARFIndex.cpp:402
lldb_private::ManualDWARFIndex::IndexSet::globals
NameToDIE globals
Definition: ManualDWARFIndex.h:65
lldb_private::ManualDWARFIndex::GetObjCMethods
void GetObjCMethods(ConstString class_name, llvm::function_ref< bool(DWARFDIE die)> callback) override
Definition: ManualDWARFIndex.cpp:366
lldb_private::ManualDWARFIndex::m_set
IndexSet m_set
Definition: ManualDWARFIndex.h:82
NameToDIE
Definition: NameToDIE.h:21
lldb_private::ManualDWARFIndex::IndexSet::function_methods
NameToDIE function_methods
Definition: ManualDWARFIndex.h:62
DWARFIndex.h