LLVM  9.0.0svn
DWARFGdbIndex.h
Go to the documentation of this file.
1 //===- DWARFGdbIndex.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_DWARFGDBINDEX_H
10 #define LLVM_DEBUGINFO_DWARF_DWARFGDBINDEX_H
11 
12 #include "llvm/ADT/SmallVector.h"
13 #include "llvm/ADT/StringRef.h"
15 #include <cstdint>
16 #include <utility>
17 
18 namespace llvm {
19 
20 class raw_ostream;
21 
23  uint32_t Version;
24 
25  uint32_t CuListOffset;
26  uint32_t TuListOffset;
27  uint32_t AddressAreaOffset;
28  uint32_t SymbolTableOffset;
29  uint32_t ConstantPoolOffset;
30 
31  struct CompUnitEntry {
32  uint64_t Offset; /// Offset of a CU in the .debug_info section.
33  uint64_t Length; /// Length of that CU.
34  };
36 
37  struct TypeUnitEntry {
38  uint64_t Offset;
39  uint64_t TypeOffset;
40  uint64_t TypeSignature;
41  };
43 
44  struct AddressEntry {
45  uint64_t LowAddress; /// The low address.
46  uint64_t HighAddress; /// The high address.
47  uint32_t CuIndex; /// The CU index.
48  };
49  SmallVector<AddressEntry, 0> AddressArea;
50 
51  struct SymTableEntry {
52  uint32_t NameOffset; /// Offset of the symbol's name in the constant pool.
53  uint32_t VecOffset; /// Offset of the CU vector in the constant pool.
54  };
56 
57  /// Each value is CU index + attributes.
59  ConstantPoolVectors;
60 
61  StringRef ConstantPoolStrings;
62  uint32_t StringPoolOffset;
63 
64  void dumpCUList(raw_ostream &OS) const;
65  void dumpTUList(raw_ostream &OS) const;
66  void dumpAddressArea(raw_ostream &OS) const;
67  void dumpSymbolTable(raw_ostream &OS) const;
68  void dumpConstantPool(raw_ostream &OS) const;
69 
70  bool parseImpl(DataExtractor Data);
71 
72 public:
73  void dump(raw_ostream &OS);
74  void parse(DataExtractor Data);
75 
76  bool HasContent = false;
77  bool HasError = false;
78 };
79 
80 } // end namespace llvm
81 
82 #endif // LLVM_DEBUGINFO_DWARF_DWARFGDBINDEX_H
This class represents lattice values for constants.
Definition: AllocatorList.h:23
void dump(raw_ostream &OS)
void parse(DataExtractor Data)
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:45
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:48