LLVM  11.0.0git
DWARFDebugPubTable.h
Go to the documentation of this file.
1 //===- DWARFDebugPubTable.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 LLVM_DEBUGINFO_DWARF_DWARFDEBUGPUBTABLE_H
10 #define LLVM_DEBUGINFO_DWARF_DWARFDEBUGPUBTABLE_H
11 
12 #include "llvm/ADT/ArrayRef.h"
13 #include "llvm/ADT/StringRef.h"
16 #include <cstdint>
17 #include <vector>
18 
19 namespace llvm {
20 
21 class raw_ostream;
22 
23 /// Represents structure for holding and parsing .debug_pub* tables.
25 public:
26  struct Entry {
27  /// Section offset from the beginning of the compilation unit.
28  uint64_t SecOffset;
29 
30  /// An entry of the various gnu_pub* debug sections.
32 
33  /// The name of the object as given by the DW_AT_name attribute of the
34  /// referenced DIE.
36  };
37 
38  /// Each table consists of sets of variable length entries. Each set describes
39  /// the names of global objects and functions, or global types, respectively,
40  /// whose definitions are represented by debugging information entries owned
41  /// by a single compilation unit.
42  struct Set {
43  /// The total length of the entries for that set, not including the length
44  /// field itself.
45  uint64_t Length;
46 
47  /// The DWARF format of the set.
49 
50  /// This number is specific to the name lookup table and is independent of
51  /// the DWARF version number.
53 
54  /// The offset from the beginning of the .debug_info section of the
55  /// compilation unit header referenced by the set.
56  uint64_t Offset;
57 
58  /// The size in bytes of the contents of the .debug_info section generated
59  /// to represent that compilation unit.
60  uint64_t Size;
61 
62  std::vector<Entry> Entries;
63  };
64 
65 private:
66  std::vector<Set> Sets;
67 
68  /// gnu styled tables contains additional information.
69  /// This flag determines whether or not section we parse is debug_gnu* table.
70  bool GnuStyle;
71 
72 public:
73  DWARFDebugPubTable(const DWARFObject &Obj, const DWARFSection &Sec,
74  bool LittleEndian, bool GnuStyle);
75 
76  void dump(raw_ostream &OS) const;
77 
78  ArrayRef<Set> getData() { return Sets; }
79 };
80 
81 } // end namespace llvm
82 
83 #endif // LLVM_DEBUGINFO_DWARF_DWARFDEBUGPUBTABLE_H
This class represents lattice values for constants.
Definition: AllocatorList.h:23
Represents structure for holding and parsing .debug_pub* tables.
void dump(raw_ostream &OS) const
DwarfFormat
Constants that define the DWARF format as 32 or 64 bit.
Definition: Dwarf.h:71
uint64_t Offset
The offset from the beginning of the .debug_info section of the compilation unit header referenced by...
Each table consists of sets of variable length entries.
DWARFDebugPubTable(const DWARFObject &Obj, const DWARFSection &Sec, bool LittleEndian, bool GnuStyle)
Describes an entry of the various gnu_pub* debug sections.
Definition: Dwarf.h:619
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Definition: APInt.h:32
uint64_t SecOffset
Section offset from the beginning of the compilation unit.
uint64_t Size
The size in bytes of the contents of the .debug_info section generated to represent that compilation ...
This file contains constants used for implementing Dwarf debug support.
uint64_t Length
The total length of the entries for that set, not including the length field itself.
dwarf::PubIndexEntryDescriptor Descriptor
An entry of the various gnu_pub* debug sections.
uint16_t Version
This number is specific to the name lookup table and is independent of the DWARF version number...
dwarf::DwarfFormat Format
The DWARF format of the set.
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:46
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:57
StringRef Name
The name of the object as given by the DW_AT_name attribute of the referenced DIE.