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_LIB_DEBUGINFO_DWARFGDBINDEX_H
11 #define LLVM_LIB_DEBUGINFO_DWARFGDBINDEX_H
13 #include "llvm/Support/DataExtractor.h"
14 #include "llvm/Support/Error.h"
15 #include "llvm/Support/raw_ostream.h"
21 uint32_t CuListOffset;
22 uint32_t AddressAreaOffset;
23 uint32_t SymbolTableOffset;
24 uint32_t ConstantPoolOffset;
26 struct CompUnitEntry {
27 uint64_t Offset; // Offset of a CU in the .debug_info section.
28 uint64_t Length; // Length of that CU.
30 SmallVector<CompUnitEntry, 0> CuList;
33 uint64_t LowAddress; // The low address.
34 uint64_t HighAddress; // The high address.
35 uint32_t CuIndex; // The CU index.
37 SmallVector<AddressEntry, 0> AddressArea;
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.
43 SmallVector<SymTableEntry, 0> SymbolTable;
45 // Each value is CU index + attributes.
46 SmallVector<std::pair<uint32_t, SmallVector<uint32_t, 0>>, 0>
49 StringRef ConstantPoolStrings;
50 uint32_t StringPoolOffset;
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;
57 bool parseImpl(DataExtractor Data);
60 void dump(raw_ostream &OS);
61 void parse(DataExtractor Data);
63 bool HasContent = false;
64 bool HasError = false;
68 #endif // LLVM_LIB_DEBUGINFO_DWARFGDBINDEX_H