LLVM 22.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"
14#include "llvm/ADT/StringRef.h"
17#include <cstdint>
18#include <vector>
19
20namespace llvm {
21
22class raw_ostream;
23class DWARFDataExtractor;
24class Error;
25
26/// Represents structure for holding and parsing .debug_pub* tables.
28public:
29 struct Entry {
30 /// Section offset from the beginning of the compilation unit.
32
33 /// An entry of the various gnu_pub* debug sections.
35
36 /// The name of the object as given by the DW_AT_name attribute of the
37 /// referenced DIE.
39 };
40
41 /// Each table consists of sets of variable length entries. Each set describes
42 /// the names of global objects and functions, or global types, respectively,
43 /// whose definitions are represented by debugging information entries owned
44 /// by a single compilation unit.
45 struct Set {
46 /// The total length of the entries for that set, not including the length
47 /// field itself.
49
50 /// The DWARF format of the set.
52
53 /// This number is specific to the name lookup table and is independent of
54 /// the DWARF version number.
56
57 /// The offset from the beginning of the .debug_info section of the
58 /// compilation unit header referenced by the set.
60
61 /// The size in bytes of the contents of the .debug_info section generated
62 /// to represent that compilation unit.
64
65 std::vector<Entry> Entries;
66 };
67
68private:
69 std::vector<Set> Sets;
70
71 /// gnu styled tables contains additional information.
72 /// This flag determines whether or not section we parse is debug_gnu* table.
73 bool GnuStyle = false;
74
75public:
76 DWARFDebugPubTable() = default;
77
78 LLVM_ABI void extract(DWARFDataExtractor Data, bool GnuStyle,
79 function_ref<void(Error)> RecoverableErrorHandler);
80
81 LLVM_ABI void dump(raw_ostream &OS) const;
82
83 ArrayRef<Set> getData() { return Sets; }
84};
85
86} // end namespace llvm
87
88#endif // LLVM_DEBUGINFO_DWARF_DWARFDEBUGPUBTABLE_H
#define LLVM_ABI
Definition: Compiler.h:213
This file contains constants used for implementing Dwarf debug support.
loop extract
raw_pwrite_stream & OS
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: ArrayRef.h:41
A DWARFDataExtractor (typically for an in-memory copy of an object-file section) plus a relocation ma...
Represents structure for holding and parsing .debug_pub* tables.
LLVM_ABI void dump(raw_ostream &OS) const
Lightweight error class with error context and mandatory checking.
Definition: Error.h:159
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:55
An efficient, type-erasing, non-owning reference to a callable.
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:53
DwarfFormat
Constants that define the DWARF format as 32 or 64 bit.
Definition: Dwarf.h:92
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
uint64_t SecOffset
Section offset from the beginning of the compilation unit.
StringRef Name
The name of the object as given by the DW_AT_name attribute of the referenced DIE.
dwarf::PubIndexEntryDescriptor Descriptor
An entry of the various gnu_pub* debug sections.
Each table consists of sets of variable length entries.
uint64_t Length
The total length of the entries for that set, not including the length field itself.
uint64_t Offset
The offset from the beginning of the .debug_info section of the compilation unit header referenced by...
dwarf::DwarfFormat Format
The DWARF format of the set.
uint64_t Size
The size in bytes of the contents of the .debug_info section generated to represent that compilation ...
uint16_t Version
This number is specific to the name lookup table and is independent of the DWARF version number.
Describes an entry of the various gnu_pub* debug sections.
Definition: Dwarf.h:1165