1 //===-- DWARFDIE.h ----------------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFDIE_H
10 #define LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFDIE_H
12 #include "DWARFBaseDIE.h"
13 #include "llvm/ADT/SmallSet.h"
15 class DWARFDIE : public DWARFBaseDIE {
17 using DWARFBaseDIE::DWARFBaseDIE;
20 bool IsStructUnionOrClass() const;
22 bool IsMethod() const;
26 // Accessing information about a DIE
27 const char *GetMangledName() const;
29 const char *GetPubname() const;
31 const char *GetQualifiedName(std::string &storage) const;
33 using DWARFBaseDIE::GetName;
34 void GetName(lldb_private::Stream &s) const;
36 void AppendTypeName(lldb_private::Stream &s) const;
38 lldb_private::Type *ResolveType() const;
40 // Resolve a type by UID using this DIE's DWARF file
41 lldb_private::Type *ResolveTypeUID(const DWARFDIE &die) const;
43 // Functions for obtaining DIE relations and references
49 GetFirstChild() const;
55 GetReferencedDIE(const dw_attr_t attr) const;
57 // Get a another DIE from the same DWARF file as this DIE. This will
58 // check the current DIE's compile unit first to see if "die_offset" is
59 // in the same compile unit, and fall back to checking the DWARF file.
61 GetDIE(dw_offset_t die_offset) const;
62 using DWARFBaseDIE::GetDIE;
65 LookupDeepestBlock(lldb::addr_t file_addr) const;
68 GetParentDeclContextDIE() const;
70 // DeclContext related functions
71 std::vector<DWARFDIE> GetDeclContextDIEs() const;
73 /// Return this DIE's decl context as it is needed to look up types
74 /// in Clang's -gmodules debug info format.
76 llvm::SmallVectorImpl<lldb_private::CompilerContext> &context) const;
78 // Getting attribute values from the DIE.
80 // GetAttributeValueAsXXX() functions should only be used if you are
81 // looking for one or two attributes on a DIE. If you are trying to
82 // parse all attributes, use GetAttributes (...) instead
84 GetAttributeValueAsReferenceDIE(const dw_attr_t attr) const;
86 bool GetDIENamesAndRanges(const char *&name, const char *&mangled,
87 DWARFRangeList &ranges, int &decl_file,
88 int &decl_line, int &decl_column, int &call_file,
89 int &call_line, int &call_column,
90 lldb_private::DWARFExpression *frame_base) const;
93 #endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_DWARFDIE_H