Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:43:41

0001 //===- DWARFGdbIndex.h ------------------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLVM_DEBUGINFO_DWARF_DWARFGDBINDEX_H
0010 #define LLVM_DEBUGINFO_DWARF_DWARFGDBINDEX_H
0011 
0012 #include "llvm/ADT/SmallVector.h"
0013 #include "llvm/ADT/StringRef.h"
0014 #include <cstdint>
0015 #include <utility>
0016 
0017 namespace llvm {
0018 
0019 class raw_ostream;
0020 class DataExtractor;
0021 
0022 class DWARFGdbIndex {
0023   uint32_t Version;
0024 
0025   uint32_t CuListOffset;
0026   uint32_t TuListOffset;
0027   uint32_t AddressAreaOffset;
0028   uint32_t SymbolTableOffset;
0029   uint32_t ConstantPoolOffset;
0030 
0031   struct CompUnitEntry {
0032     uint64_t Offset; /// Offset of a CU in the .debug_info section.
0033     uint64_t Length; /// Length of that CU.
0034   };
0035   SmallVector<CompUnitEntry, 0> CuList;
0036 
0037   struct TypeUnitEntry {
0038     uint64_t Offset;
0039     uint64_t TypeOffset;
0040     uint64_t TypeSignature;
0041   };
0042   SmallVector<TypeUnitEntry, 0> TuList;
0043 
0044   struct AddressEntry {
0045     uint64_t LowAddress;  /// The low address.
0046     uint64_t HighAddress; /// The high address.
0047     uint32_t CuIndex;     /// The CU index.
0048   };
0049   SmallVector<AddressEntry, 0> AddressArea;
0050 
0051   struct SymTableEntry {
0052     uint32_t NameOffset; /// Offset of the symbol's name in the constant pool.
0053     uint32_t VecOffset;  /// Offset of the CU vector in the constant pool.
0054   };
0055   SmallVector<SymTableEntry, 0> SymbolTable;
0056 
0057   /// Each value is CU index + attributes.
0058   SmallVector<std::pair<uint32_t, SmallVector<uint32_t, 0>>, 0>
0059       ConstantPoolVectors;
0060 
0061   StringRef ConstantPoolStrings;
0062   uint32_t StringPoolOffset;
0063 
0064   void dumpCUList(raw_ostream &OS) const;
0065   void dumpTUList(raw_ostream &OS) const;
0066   void dumpAddressArea(raw_ostream &OS) const;
0067   void dumpSymbolTable(raw_ostream &OS) const;
0068   void dumpConstantPool(raw_ostream &OS) const;
0069 
0070   bool parseImpl(DataExtractor Data);
0071 
0072 public:
0073   void dump(raw_ostream &OS);
0074   void parse(DataExtractor Data);
0075 
0076   bool HasContent = false;
0077   bool HasError = false;
0078 };
0079 
0080 } // end namespace llvm
0081 
0082 #endif // LLVM_DEBUGINFO_DWARF_DWARFGDBINDEX_H