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 AddressAreaOffset;
28 uint32_t SymbolTableOffset;
29 uint32_t ConstantPoolOffset;
31 struct CompUnitEntry {
32 uint64_t Offset; // Offset of a CU in the .debug_info section.
33 uint64_t Length; // Length of that CU.
35 SmallVector<CompUnitEntry, 0> CuList;
38 uint64_t LowAddress; // The low address.
39 uint64_t HighAddress; // The high address.
40 uint32_t CuIndex; // The CU index.
42 SmallVector<AddressEntry, 0> AddressArea;
44 struct SymTableEntry {
45 uint32_t NameOffset; // Offset of the symbol's name in the constant pool.
46 uint32_t VecOffset; // Offset of the CU vector in the constant pool.
48 SmallVector<SymTableEntry, 0> SymbolTable;
50 // Each value is CU index + attributes.
51 SmallVector<std::pair<uint32_t, SmallVector<uint32_t, 0>>, 0>
54 StringRef ConstantPoolStrings;
55 uint32_t StringPoolOffset;
57 void dumpCUList(raw_ostream &OS) const;
58 void dumpAddressArea(raw_ostream &OS) const;
59 void dumpSymbolTable(raw_ostream &OS) const;
60 void dumpConstantPool(raw_ostream &OS) const;
62 bool parseImpl(DataExtractor Data);
65 void dump(raw_ostream &OS);
66 void parse(DataExtractor Data);
68 bool HasContent = false;
69 bool HasError = false;
72 } // end namespace llvm
74 #endif // LLVM_DEBUGINFO_DWARF_DWARFGDBINDEX_H