1 //===- GdbIndex.h --------------------------------------------*- C++ -*-===//
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===-------------------------------------------------------------------===//
10 #ifndef LLD_ELF_GDB_INDEX_H
11 #define LLD_ELF_GDB_INDEX_H
13 #include "InputFiles.h"
14 #include "llvm/DebugInfo/DWARF/DWARFContext.h"
15 #include "llvm/Object/ELF.h"
22 struct LLDDWARFSection final : public llvm::DWARFSection {
23 InputSectionBase *Sec = nullptr;
26 template <class ELFT> class LLDDwarfObj final : public llvm::DWARFObject {
27 LLDDWARFSection InfoSection;
28 LLDDWARFSection RangeSection;
29 LLDDWARFSection LineSection;
30 StringRef AbbrevSection;
31 StringRef GnuPubNamesSection;
32 StringRef GnuPubTypesSection;
35 template <class RelTy>
36 llvm::Optional<llvm::RelocAddrEntry> findAux(const InputSectionBase &Sec,
38 ArrayRef<RelTy> Rels) const;
41 explicit LLDDwarfObj(ObjFile<ELFT> *Obj);
42 const llvm::DWARFSection &getInfoSection() const override {
45 const llvm::DWARFSection &getRangeSection() const override {
48 const llvm::DWARFSection &getLineSection() const override {
51 StringRef getFileName() const override { return ""; }
52 StringRef getAbbrevSection() const override { return AbbrevSection; }
53 StringRef getStringSection() const override { return StrSection; }
54 StringRef getGnuPubNamesSection() const override {
55 return GnuPubNamesSection;
57 StringRef getGnuPubTypesSection() const override {
58 return GnuPubTypesSection;
60 bool isLittleEndian() const override {
61 return ELFT::TargetEndianness == llvm::support::little;
63 llvm::Optional<llvm::RelocAddrEntry> find(const llvm::DWARFSection &Sec,
64 uint64_t Pos) const override;