LLDB  mainline
AppleDWARFIndex.h
Go to the documentation of this file.
1 //===-- AppleDWARFIndex.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_APPLEDWARFINDEX_H
10 #define LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_APPLEDWARFINDEX_H
11 
14 
15 namespace lldb_private {
16 class AppleDWARFIndex : public DWARFIndex {
17 public:
18  static std::unique_ptr<AppleDWARFIndex>
19  Create(Module &module, DWARFDataExtractor apple_names,
20  DWARFDataExtractor apple_namespaces, DWARFDataExtractor apple_types,
21  DWARFDataExtractor apple_objc, DWARFDataExtractor debug_str);
22 
24  Module &module, std::unique_ptr<DWARFMappedHash::MemoryTable> apple_names,
25  std::unique_ptr<DWARFMappedHash::MemoryTable> apple_namespaces,
26  std::unique_ptr<DWARFMappedHash::MemoryTable> apple_types,
27  std::unique_ptr<DWARFMappedHash::MemoryTable> apple_objc)
28  : DWARFIndex(module), m_apple_names_up(std::move(apple_names)),
29  m_apple_namespaces_up(std::move(apple_namespaces)),
30  m_apple_types_up(std::move(apple_types)),
31  m_apple_objc_up(std::move(apple_objc)) {}
32 
33  void Preload() override {}
34 
35  void
37  llvm::function_ref<bool(DWARFDIE die)> callback) override;
38  void
40  llvm::function_ref<bool(DWARFDIE die)> callback) override;
41  void
43  llvm::function_ref<bool(DWARFDIE die)> callback) override;
44  void GetObjCMethods(ConstString class_name,
45  llvm::function_ref<bool(DWARFDIE die)> callback) override;
47  ConstString class_name, bool must_be_implementation,
48  llvm::function_ref<bool(DWARFDIE die)> callback) override;
49  void GetTypes(ConstString name,
50  llvm::function_ref<bool(DWARFDIE die)> callback) override;
51  void GetTypes(const DWARFDeclContext &context,
52  llvm::function_ref<bool(DWARFDIE die)> callback) override;
53  void GetNamespaces(ConstString name,
54  llvm::function_ref<bool(DWARFDIE die)> callback) override;
56  const CompilerDeclContext &parent_decl_ctx,
57  uint32_t name_type_mask,
58  llvm::function_ref<bool(DWARFDIE die)> callback) override;
59  void GetFunctions(const RegularExpression &regex,
60  llvm::function_ref<bool(DWARFDIE die)> callback) override;
61 
62  void Dump(Stream &s) override;
63 
64 private:
65  std::unique_ptr<DWARFMappedHash::MemoryTable> m_apple_names_up;
66  std::unique_ptr<DWARFMappedHash::MemoryTable> m_apple_namespaces_up;
67  std::unique_ptr<DWARFMappedHash::MemoryTable> m_apple_types_up;
68  std::unique_ptr<DWARFMappedHash::MemoryTable> m_apple_objc_up;
69 };
70 } // namespace lldb_private
71 
72 #endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_APPLEDWARFINDEX_H
lldb_private::RegularExpression
Definition: RegularExpression.h:18
lldb_private::AppleDWARFIndex
Definition: AppleDWARFIndex.h:16
lldb_private::AppleDWARFIndex::GetCompleteObjCClass
void GetCompleteObjCClass(ConstString class_name, bool must_be_implementation, llvm::function_ref< bool(DWARFDIE die)> callback) override
Definition: AppleDWARFIndex.cpp:100
lldb_private::AppleDWARFIndex::GetObjCMethods
void GetObjCMethods(ConstString class_name, llvm::function_ref< bool(DWARFDIE die)> callback) override
Definition: AppleDWARFIndex.cpp:91
lldb_private::AppleDWARFIndex::Create
static std::unique_ptr< AppleDWARFIndex > Create(Module &module, DWARFDataExtractor apple_names, DWARFDataExtractor apple_namespaces, DWARFDataExtractor apple_types, DWARFDataExtractor apple_objc, DWARFDataExtractor debug_str)
Definition: AppleDWARFIndex.cpp:20
SymbolFileDWARF
Definition: SymbolFileDWARF.h:59
lldb_private::Module
Definition: Module.h:85
lldb_private::AppleDWARFIndex::Dump
void Dump(Stream &s) override
Definition: AppleDWARFIndex.cpp:204
lldb_private::Stream
Definition: Stream.h:28
lldb_private::DWARFDataExtractor
Definition: DWARFDataExtractor.h:18
lldb_private::AppleDWARFIndex::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: AppleDWARFIndex.cpp:182
DWARFDIE
Definition: DWARFDIE.h:16
lldb_private::DWARFIndex
Definition: DWARFIndex.h:22
DWARFUnit
Definition: DWARFUnit.h:81
lldb_private::AppleDWARFIndex::m_apple_namespaces_up
std::unique_ptr< DWARFMappedHash::MemoryTable > m_apple_namespaces_up
Definition: AppleDWARFIndex.h:66
dwarf
Definition: ABISysV_arc.cpp:61
lldb_private::AppleDWARFIndex::AppleDWARFIndex
AppleDWARFIndex(Module &module, std::unique_ptr< DWARFMappedHash::MemoryTable > apple_names, std::unique_ptr< DWARFMappedHash::MemoryTable > apple_namespaces, std::unique_ptr< DWARFMappedHash::MemoryTable > apple_types, std::unique_ptr< DWARFMappedHash::MemoryTable > apple_objc)
Definition: AppleDWARFIndex.h:23
lldb_private::ConstString
Definition: ConstString.h:40
lldb_private::AppleDWARFIndex::Preload
void Preload() override
Definition: AppleDWARFIndex.h:33
HashedNameToDIE.h
lldb_private::CompilerDeclContext
Represents a generic declaration context in a program.
Definition: CompilerDeclContext.h:30
uint32_t
lldb_private::AppleDWARFIndex::GetTypes
void GetTypes(ConstString name, llvm::function_ref< bool(DWARFDIE die)> callback) override
Definition: AppleDWARFIndex.cpp:111
DWARFDeclContext
Definition: DWARFDeclContext.h:23
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::AppleDWARFIndex::m_apple_objc_up
std::unique_ptr< DWARFMappedHash::MemoryTable > m_apple_objc_up
Definition: AppleDWARFIndex.h:68
lldb_private::AppleDWARFIndex::m_apple_names_up
std::unique_ptr< DWARFMappedHash::MemoryTable > m_apple_names_up
Definition: AppleDWARFIndex.h:65
lldb_private::AppleDWARFIndex::GetNamespaces
void GetNamespaces(ConstString name, llvm::function_ref< bool(DWARFDIE die)> callback) override
Definition: AppleDWARFIndex.cpp:174
lldb_private::AppleDWARFIndex::m_apple_types_up
std::unique_ptr< DWARFMappedHash::MemoryTable > m_apple_types_up
Definition: AppleDWARFIndex.h:67
DWARFIndex.h
lldb_private::AppleDWARFIndex::GetGlobalVariables
void GetGlobalVariables(ConstString basename, llvm::function_ref< bool(DWARFDIE die)> callback) override
Finds global variables with the given base name.
Definition: AppleDWARFIndex.cpp:55