LLDB  mainline
DWARFIndex.h
Go to the documentation of this file.
1 //===-- DWARFIndex.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_DWARFINDEX_H
10 #define LLDB_DWARFINDEX_H
11 
15 
16 class DWARFDebugInfo;
17 class DWARFDeclContext;
18 class DWARFDIE;
19 
20 namespace lldb_private {
21 class DWARFIndex {
22 public:
23  DWARFIndex(Module &module) : m_module(module) {}
24  virtual ~DWARFIndex();
25 
26  virtual void Preload() = 0;
27 
28  /// Finds global variables with the given base name. Any additional filtering
29  /// (e.g., to only retrieve variables from a given context) should be done by
30  /// the consumer.
31  virtual void GetGlobalVariables(ConstString basename, DIEArray &offsets) = 0;
32 
33  virtual void GetGlobalVariables(const RegularExpression &regex,
34  DIEArray &offsets) = 0;
35  virtual void GetGlobalVariables(const DWARFUnit &cu, DIEArray &offsets) = 0;
36  virtual void GetObjCMethods(ConstString class_name, DIEArray &offsets) = 0;
37  virtual void GetCompleteObjCClass(ConstString class_name,
38  bool must_be_implementation,
39  DIEArray &offsets) = 0;
40  virtual void GetTypes(ConstString name, DIEArray &offsets) = 0;
41  virtual void GetTypes(const DWARFDeclContext &context, DIEArray &offsets) = 0;
42  virtual void GetNamespaces(ConstString name, DIEArray &offsets) = 0;
43  virtual void GetFunctions(ConstString name, DWARFDebugInfo &info,
44  const CompilerDeclContext &parent_decl_ctx,
45  uint32_t name_type_mask,
46  std::vector<DWARFDIE> &dies) = 0;
47  virtual void GetFunctions(const RegularExpression &regex,
48  DIEArray &offsets) = 0;
49 
50  virtual void ReportInvalidDIEOffset(dw_offset_t offset,
51  llvm::StringRef name) = 0;
52  virtual void Dump(Stream &s) = 0;
53 
54 protected:
56 
57  /// Helper function implementing common logic for processing function dies. If
58  /// the function given by "ref" matches search criteria given by
59  /// "parent_decl_ctx" and "name_type_mask", it is inserted into the "dies"
60  /// vector.
61  void ProcessFunctionDIE(llvm::StringRef name, DIERef ref,
62  DWARFDebugInfo &info,
63  const CompilerDeclContext &parent_decl_ctx,
64  uint32_t name_type_mask, std::vector<DWARFDIE> &dies);
65 };
66 } // namespace lldb_private
67 
68 #endif // LLDB_DWARFINDEX_H
Enumerations for broadcasting.
Definition: SBLaunchInfo.h:14
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
void ProcessFunctionDIE(llvm::StringRef name, DIERef ref, DWARFDebugInfo &info, const CompilerDeclContext &parent_decl_ctx, uint32_t name_type_mask, std::vector< DWARFDIE > &dies)
Helper function implementing common logic for processing function dies.
Definition: DWARFIndex.cpp:20
virtual void ReportInvalidDIEOffset(dw_offset_t offset, llvm::StringRef name)=0
"lldb/Utility/RegularExpression.h" A C++ wrapper class for regex.
virtual void GetCompleteObjCClass(ConstString class_name, bool must_be_implementation, DIEArray &offsets)=0
virtual void GetGlobalVariables(ConstString basename, DIEArray &offsets)=0
Finds global variables with the given base name.
Definition: DIERef.h:18
virtual void GetObjCMethods(ConstString class_name, DIEArray &offsets)=0
std::vector< DIERef > DIEArray
Definition: DIERef.h:51
virtual void GetFunctions(ConstString name, DWARFDebugInfo &info, const CompilerDeclContext &parent_decl_ctx, uint32_t name_type_mask, std::vector< DWARFDIE > &dies)=0
virtual void GetTypes(ConstString name, DIEArray &offsets)=0
virtual void Preload()=0
A class that describes an executable image and its associated object and symbol files.
Definition: Module.h:109
virtual void Dump(Stream &s)=0
A uniqued constant string class.
Definition: ConstString.h:38
char * basename(char *path)
virtual void GetNamespaces(ConstString name, DIEArray &offsets)=0
DWARFIndex(Module &module)
Definition: DWARFIndex.h:23