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_APPLEDWARFINDEX_H
10 #define LLDB_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 GetGlobalVariables(ConstString basename, DIEArray &offsets) override;
36  void GetGlobalVariables(const RegularExpression &regex,
37  DIEArray &offsets) override;
38  void GetGlobalVariables(const DWARFUnit &cu, DIEArray &offsets) override;
39  void GetObjCMethods(ConstString class_name, DIEArray &offsets) override;
40  void GetCompleteObjCClass(ConstString class_name, bool must_be_implementation,
41  DIEArray &offsets) override;
42  void GetTypes(ConstString name, DIEArray &offsets) override;
43  void GetTypes(const DWARFDeclContext &context, DIEArray &offsets) override;
44  void GetNamespaces(ConstString name, DIEArray &offsets) override;
45  void GetFunctions(ConstString name, DWARFDebugInfo &info,
46  const CompilerDeclContext &parent_decl_ctx,
47  uint32_t name_type_mask,
48  std::vector<DWARFDIE> &dies) override;
49  void GetFunctions(const RegularExpression &regex, DIEArray &offsets) override;
50 
52  llvm::StringRef name) override;
53  void Dump(Stream &s) override;
54 
55 private:
56  std::unique_ptr<DWARFMappedHash::MemoryTable> m_apple_names_up;
57  std::unique_ptr<DWARFMappedHash::MemoryTable> m_apple_namespaces_up;
58  std::unique_ptr<DWARFMappedHash::MemoryTable> m_apple_types_up;
59  std::unique_ptr<DWARFMappedHash::MemoryTable> m_apple_objc_up;
60 };
61 } // namespace lldb_private
62 
63 #endif // LLDB_APPLEDWARFINDEX_H
Enumerations for broadcasting.
Definition: SBLaunchInfo.h:14
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
void Dump(Stream &s) override
void GetTypes(ConstString name, DIEArray &offsets) override
"lldb/Utility/RegularExpression.h" A C++ wrapper class for regex.
void GetCompleteObjCClass(ConstString class_name, bool must_be_implementation, DIEArray &offsets) override
std::vector< DIERef > DIEArray
Definition: DIERef.h:51
void GetNamespaces(ConstString name, DIEArray &offsets) override
void ReportInvalidDIEOffset(dw_offset_t offset, llvm::StringRef name) override
void GetGlobalVariables(ConstString basename, DIEArray &offsets) override
Finds global variables with the given base name.
A class that describes an executable image and its associated object and symbol files.
Definition: Module.h:109
static std::unique_ptr< AppleDWARFIndex > Create(Module &module, DWARFDataExtractor apple_names, DWARFDataExtractor apple_namespaces, DWARFDataExtractor apple_types, DWARFDataExtractor apple_objc, DWARFDataExtractor debug_str)
void GetFunctions(ConstString name, DWARFDebugInfo &info, const CompilerDeclContext &parent_decl_ctx, uint32_t name_type_mask, std::vector< DWARFDIE > &dies) override
void GetObjCMethods(ConstString class_name, DIEArray &offsets) override
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)
A uniqued constant string class.
Definition: ConstString.h:38
char * basename(char *path)