LLVM  8.0.1
DWARFDebugPubTable.h
Go to the documentation of this file.
1 //===- DWARFDebugPubTable.h -------------------------------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_DEBUGINFO_DWARF_DWARFDEBUGPUBTABLE_H
11 #define LLVM_DEBUGINFO_DWARF_DWARFDEBUGPUBTABLE_H
12 
13 #include "llvm/ADT/ArrayRef.h"
14 #include "llvm/ADT/StringRef.h"
17 #include <cstdint>
18 #include <vector>
19 
20 namespace llvm {
21 
22 class raw_ostream;
23 
24 /// Represents structure for holding and parsing .debug_pub* tables.
26 public:
27  struct Entry {
28  /// Section offset from the beginning of the compilation unit.
30 
31  /// An entry of the various gnu_pub* debug sections.
33 
34  /// The name of the object as given by the DW_AT_name attribute of the
35  /// referenced DIE.
37  };
38 
39  /// Each table consists of sets of variable length entries. Each set describes
40  /// the names of global objects and functions, or global types, respectively,
41  /// whose definitions are represented by debugging information entries owned
42  /// by a single compilation unit.
43  struct Set {
44  /// The total length of the entries for that set, not including the length
45  /// field itself.
47 
48  /// This number is specific to the name lookup table and is independent of
49  /// the DWARF version number.
50  uint16_t Version;
51 
52  /// The offset from the beginning of the .debug_info section of the
53  /// compilation unit header referenced by the set.
55 
56  /// The size in bytes of the contents of the .debug_info section generated
57  /// to represent that compilation unit.
59 
60  std::vector<Entry> Entries;
61  };
62 
63 private:
64  std::vector<Set> Sets;
65 
66  /// gnu styled tables contains additional information.
67  /// This flag determines whether or not section we parse is debug_gnu* table.
68  bool GnuStyle;
69 
70 public:
71  DWARFDebugPubTable(const DWARFObject &Obj, const DWARFSection &Sec,
72  bool LittleEndian, bool GnuStyle);
73 
74  void dump(raw_ostream &OS) const;
75 
76  ArrayRef<Set> getData() { return Sets; }
77 };
78 
79 } // end namespace llvm
80 
81 #endif // LLVM_DEBUGINFO_DWARF_DWARFDEBUGPUBTABLE_H
This class represents lattice values for constants.
Definition: AllocatorList.h:24
Represents structure for holding and parsing .debug_pub* tables.
void dump(raw_ostream &OS) const
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:561
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Definition: APInt.h:33
uint32_t Size
The size in bytes of the contents of the .debug_info section generated to represent that compilation ...
uint32_t Length
The total length of the entries for that set, not including the length field itself.
uint32_t Offset
The offset from the beginning of the .debug_info section of the compilation unit header referenced by...
uint32_t SecOffset
Section offset from the beginning of the compilation unit.
This file contains constants used for implementing Dwarf debug support.
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...
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:49
StringRef Name
The name of the object as given by the DW_AT_name attribute of the referenced DIE.