1 //===- DWARFGdbIndex.h ------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_DEBUGINFO_DWARF_DWARFGDBINDEX_H
11 #define LLVM_DEBUGINFO_DWARF_DWARFGDBINDEX_H
13 #include "llvm/ADT/SmallVector.h"
14 #include "llvm/ADT/StringRef.h"
15 #include "llvm/Support/DataExtractor.h"
26 uint32_t CuListOffset;
27 uint32_t TuListOffset;
28 uint32_t AddressAreaOffset;
29 uint32_t SymbolTableOffset;
30 uint32_t ConstantPoolOffset;
32 struct CompUnitEntry {
33 uint64_t Offset; /// Offset of a CU in the .debug_info section.
34 uint64_t Length; /// Length of that CU.
36 SmallVector<CompUnitEntry, 0> CuList;
38 struct TypeUnitEntry {
41 uint64_t TypeSignature;
43 SmallVector<TypeUnitEntry, 0> TuList;
46 uint64_t LowAddress; /// The low address.
47 uint64_t HighAddress; /// The high address.
48 uint32_t CuIndex; /// The CU index.
50 SmallVector<AddressEntry, 0> AddressArea;
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.
56 SmallVector<SymTableEntry, 0> SymbolTable;
58 /// Each value is CU index + attributes.
59 SmallVector<std::pair<uint32_t, SmallVector<uint32_t, 0>>, 0>
62 StringRef ConstantPoolStrings;
63 uint32_t StringPoolOffset;
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;
71 bool parseImpl(DataExtractor Data);
74 void dump(raw_ostream &OS);
75 void parse(DataExtractor Data);
77 bool HasContent = false;
78 bool HasError = false;
81 } // end namespace llvm
83 #endif // LLVM_DEBUGINFO_DWARF_DWARFGDBINDEX_H