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;
49  void GetFunctions(ConstString name, SymbolFileDWARF &dwarf,
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();
70  void IndexUnit(DWARFUnit &unit, SymbolFileDWARFDwo *dwp, IndexSet &set);
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
A class that represents a running process on the host machine.
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
Represents a generic declaration context in a program.
void GetFunctions(ConstString name, SymbolFileDWARF &dwarf, const CompilerDeclContext &parent_decl_ctx, uint32_t name_type_mask, llvm::function_ref< bool(DWARFDIE die)> callback) override
llvm::DenseSet< dw_offset_t > m_units_to_avoid
Which dwarf units should we skip while building the index.
void GetNamespaces(ConstString name, llvm::function_ref< bool(DWARFDIE die)> callback) override
ManualDWARFIndex(Module &module, SymbolFileDWARF &dwarf, llvm::DenseSet< dw_offset_t > units_to_avoid={})
void GetObjCMethods(ConstString class_name, llvm::function_ref< bool(DWARFDIE die)> callback) override
void IndexUnit(DWARFUnit &unit, SymbolFileDWARFDwo *dwp, IndexSet &set)
SymbolFileDWARF * m_dwarf
The DWARF file which we are indexing.
LanguageType
Programming language type.
static void IndexUnitImpl(DWARFUnit &unit, const lldb::LanguageType cu_language, IndexSet &set)
A class that describes an executable image and its associated object and symbol files.
Definition: Module.h:75
void GetCompleteObjCClass(ConstString class_name, bool must_be_implementation, llvm::function_ref< bool(DWARFDIE die)> callback) override
void GetGlobalVariables(ConstString basename, llvm::function_ref< bool(DWARFDIE die)> callback) override
Finds global variables with the given base name.
A uniqued constant string class.
Definition: ConstString.h:40
void GetTypes(ConstString name, llvm::function_ref< bool(DWARFDIE die)> callback) override
void Dump(Stream &s) override
DWARFIndex(Module &module)
Definition: DWARFIndex.h:22