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