]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/include/llvm/DebugInfo/DWARF/DWARFGdbIndex.h
MFV r316920: 8023 Panic destroying a metaslab deferred range tree
[FreeBSD/FreeBSD.git] / contrib / llvm / include / llvm / DebugInfo / DWARF / DWARFGdbIndex.h
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_LIB_DEBUGINFO_DWARFGDBINDEX_H
11 #define LLVM_LIB_DEBUGINFO_DWARFGDBINDEX_H
12
13 #include "llvm/Support/DataExtractor.h"
14 #include "llvm/Support/Error.h"
15 #include "llvm/Support/raw_ostream.h"
16
17 namespace llvm {
18 class DWARFGdbIndex {
19   uint32_t Version;
20
21   uint32_t CuListOffset;
22   uint32_t AddressAreaOffset;
23   uint32_t SymbolTableOffset;
24   uint32_t ConstantPoolOffset;
25
26   struct CompUnitEntry {
27     uint64_t Offset; // Offset of a CU in the .debug_info section.
28     uint64_t Length; // Length of that CU.
29   };
30   SmallVector<CompUnitEntry, 0> CuList;
31
32   struct AddressEntry {
33     uint64_t LowAddress;  // The low address.
34     uint64_t HighAddress; // The high address.
35     uint32_t CuIndex;     // The CU index.
36   };
37   SmallVector<AddressEntry, 0> AddressArea;
38
39   struct SymTableEntry {
40     uint32_t NameOffset; // Offset of the symbol's name in the constant pool.
41     uint32_t VecOffset;  // Offset of the CU vector in the constant pool.
42   };
43   SmallVector<SymTableEntry, 0> SymbolTable;
44
45   // Each value is CU index + attributes.
46   SmallVector<std::pair<uint32_t, SmallVector<uint32_t, 0>>, 0>
47       ConstantPoolVectors;
48
49   StringRef ConstantPoolStrings;
50   uint32_t StringPoolOffset;
51
52   void dumpCUList(raw_ostream &OS) const;
53   void dumpAddressArea(raw_ostream &OS) const;
54   void dumpSymbolTable(raw_ostream &OS) const;
55   void dumpConstantPool(raw_ostream &OS) const;
56
57   bool parseImpl(DataExtractor Data);
58
59 public:
60   void dump(raw_ostream &OS);
61   void parse(DataExtractor Data);
62
63   bool HasContent = false;
64   bool HasError = false;
65 };
66 }
67
68 #endif // LLVM_LIB_DEBUGINFO_DWARFGDBINDEX_H