LLDB  mainline
DWARFDIE.h
Go to the documentation of this file.
1 //===-- DWARFDIE.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 SymbolFileDWARF_DWARFDIE_h_
10 #define SymbolFileDWARF_DWARFDIE_h_
11 
12 #include "DWARFBaseDIE.h"
13 #include "llvm/ADT/SmallSet.h"
14 
15 class DWARFDIE : public DWARFBaseDIE {
16 public:
18 
19  // Tests
20  bool IsStructUnionOrClass() const;
21 
22  bool IsMethod() const;
23 
24  // Accessors
25  lldb::ModuleSP GetContainingDWOModule() const;
26 
27  DWARFDIE
29 
30  // Accessing information about a DIE
31  const char *GetMangledName() const;
32 
33  const char *GetPubname() const;
34 
35  const char *GetQualifiedName(std::string &storage) const;
36 
38 
39  // Resolve a type by UID using this DIE's DWARF file
40  lldb_private::Type *ResolveTypeUID(const DIERef &die_ref) const;
41 
42  // Functions for obtaining DIE relations and references
43 
44  DWARFDIE
45  GetParent() const;
46 
47  DWARFDIE
48  GetFirstChild() const;
49 
50  DWARFDIE
51  GetSibling() const;
52 
53  DWARFDIE
54  GetReferencedDIE(const dw_attr_t attr) const;
55 
56  // Get a another DIE from the same DWARF file as this DIE. This will
57  // check the current DIE's compile unit first to see if "die_offset" is
58  // in the same compile unit, and fall back to checking the DWARF file.
59  DWARFDIE
60  GetDIE(dw_offset_t die_offset) const;
62 
63  DWARFDIE
64  LookupDeepestBlock(lldb::addr_t file_addr) const;
65 
66  DWARFDIE
68 
69  // DeclContext related functions
70  std::vector<DWARFDIE> GetDeclContextDIEs() const;
71 
72  void GetDWARFDeclContext(DWARFDeclContext &dwarf_decl_ctx) const;
73 
74  /// Return this DIE's decl context as it is needed to look up types
75  /// in Clang's -gmodules debug info format.
76  void
77  GetDeclContext(std::vector<lldb_private::CompilerContext> &context) const;
78 
79  // Getting attribute values from the DIE.
80  //
81  // GetAttributeValueAsXXX() functions should only be used if you are
82  // looking for one or two attributes on a DIE. If you are trying to
83  // parse all attributes, use GetAttributes (...) instead
84  DWARFDIE
86 
87  bool GetDIENamesAndRanges(const char *&name, const char *&mangled,
88  DWARFRangeList &ranges, int &decl_file,
89  int &decl_line, int &decl_column, int &call_file,
90  int &call_line, int &call_column,
91  lldb_private::DWARFExpression *frame_base) const;
92 
93  // CompilerDecl related functions
94 
96 
98 
100 };
101 
102 #endif // SymbolFileDWARF_DWARFDIE_h_
DWARFDIE GetFirstChild() const
Definition: DWARFDIE.cpp:98
lldb::ModuleSP GetContainingDWOModule() const
Definition: DWARFDIE.cpp:315
"lldb/Expression/DWARFExpression.h" Encapsulates a DWARF location expression and interprets it...
lldb_private::CompilerDeclContext GetContainingDeclContext() const
Definition: DWARFDIE.cpp:357
DWARFDIE GetParent() const
Definition: DWARFDIE.cpp:90
lldb_private::CompilerDecl GetDecl() const
Definition: DWARFDIE.cpp:341
const char * GetQualifiedName(std::string &storage) const
Definition: DWARFDIE.cpp:180
Definition: DIERef.h:18
DWARFDIE GetAttributeValueAsReferenceDIE(const dw_attr_t attr) const
Definition: DWARFDIE.cpp:132
lldb_private::CompilerDeclContext GetDeclContext() const
Definition: DWARFDIE.cpp:349
const char * GetPubname() const
Definition: DWARFDIE.cpp:173
bool IsStructUnionOrClass() const
Definition: DWARFDIE.cpp:282
lldb_private::Type * ResolveTypeUID(const DIERef &die_ref) const
Definition: DWARFDIE.cpp:194
DWARFDIE GetSibling() const
Definition: DWARFDIE.cpp:106
const char * GetMangledName() const
Definition: DWARFDIE.cpp:166
bool GetDIENamesAndRanges(const char *&name, const char *&mangled, DWARFRangeList &ranges, int &decl_file, int &decl_line, int &decl_column, int &call_file, int &call_line, int &call_column, lldb_private::DWARFExpression *frame_base) const
Definition: DWARFDIE.cpp:328
DWARFDIE GetReferencedDIE(const dw_attr_t attr) const
Definition: DWARFDIE.cpp:114
std::vector< DWARFDIE > GetDeclContextDIEs() const
Definition: DWARFDIE.cpp:202
DWARFDebugInfoEntry * GetDIE() const
Definition: DWARFBaseDIE.h:54
void GetDWARFDeclContext(DWARFDeclContext &dwarf_decl_ctx) const
Definition: DWARFDIE.cpp:216
uint64_t addr_t
Definition: lldb-types.h:83
DWARFDIE GetContainingDWOModuleDIE() const
Definition: DWARFDIE.cpp:296
DWARFDIE GetParentDeclContextDIE() const
Definition: DWARFDIE.cpp:275
lldb_private::Type * ResolveType() const
Definition: DWARFDIE.cpp:187
bool IsMethod() const
Definition: DWARFDIE.cpp:288
DWARFDIE LookupDeepestBlock(lldb::addr_t file_addr) const
Definition: DWARFDIE.cpp:146