Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 1 | //===-- DWARFContext.h ------------------------------------------*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===/ |
| 9 | |
| 10 | #ifndef LLVM_DEBUGINFO_DWARFCONTEXT_H |
| 11 | #define LLVM_DEBUGINFO_DWARFCONTEXT_H |
| 12 | |
| 13 | #include "DWARFCompileUnit.h" |
Benjamin Kramer | a6002fd | 2011-09-14 01:09:52 +0000 | [diff] [blame] | 14 | #include "DWARFDebugAranges.h" |
Eli Bendersky | fd08bc1 | 2013-02-05 23:30:58 +0000 | [diff] [blame] | 15 | #include "DWARFDebugFrame.h" |
Benjamin Kramer | 5acab50 | 2011-09-15 02:12:05 +0000 | [diff] [blame] | 16 | #include "DWARFDebugLine.h" |
David Blaikie | 18e7350 | 2013-06-19 21:37:13 +0000 | [diff] [blame] | 17 | #include "DWARFDebugLoc.h" |
Alexey Samsonov | 034e57a | 2012-08-27 07:17:47 +0000 | [diff] [blame] | 18 | #include "DWARFDebugRangeList.h" |
David Blaikie | 03c089c | 2013-09-23 22:44:47 +0000 | [diff] [blame] | 19 | #include "DWARFTypeUnit.h" |
Chandler Carruth | 8a8cd2b | 2014-01-07 11:48:04 +0000 | [diff] [blame] | 20 | #include "llvm/ADT/MapVector.h" |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 21 | #include "llvm/ADT/SmallVector.h" |
Chandler Carruth | 802d755 | 2012-12-04 07:12:27 +0000 | [diff] [blame] | 22 | #include "llvm/DebugInfo/DIContext.h" |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 23 | |
| 24 | namespace llvm { |
| 25 | |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 26 | /// DWARFContext |
| 27 | /// This data structure is the top level entity that deals with dwarf debug |
| 28 | /// information parsing. The actual data is supplied through pure virtual |
| 29 | /// methods that a concrete implementation provides. |
| 30 | class DWARFContext : public DIContext { |
Alexey Samsonov | 1eabf98 | 2014-03-13 07:52:54 +0000 | [diff] [blame^] | 31 | typedef SmallVector<DWARFCompileUnit *, 1> CUVector; |
| 32 | typedef SmallVector<DWARFTypeUnit *, 1> TUVector; |
| 33 | |
| 34 | CUVector CUs; |
| 35 | TUVector TUs; |
Ahmed Charles | 56440fd | 2014-03-06 05:51:42 +0000 | [diff] [blame] | 36 | std::unique_ptr<DWARFDebugAbbrev> Abbrev; |
| 37 | std::unique_ptr<DWARFDebugLoc> Loc; |
| 38 | std::unique_ptr<DWARFDebugAranges> Aranges; |
| 39 | std::unique_ptr<DWARFDebugLine> Line; |
| 40 | std::unique_ptr<DWARFDebugFrame> DebugFrame; |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 41 | |
Alexey Samsonov | 1eabf98 | 2014-03-13 07:52:54 +0000 | [diff] [blame^] | 42 | CUVector DWOCUs; |
| 43 | TUVector DWOTUs; |
Ahmed Charles | 56440fd | 2014-03-06 05:51:42 +0000 | [diff] [blame] | 44 | std::unique_ptr<DWARFDebugAbbrev> AbbrevDWO; |
Eric Christopher | da4b219 | 2013-01-02 23:52:13 +0000 | [diff] [blame] | 45 | |
Craig Topper | b1d83e8 | 2012-09-18 02:01:41 +0000 | [diff] [blame] | 46 | DWARFContext(DWARFContext &) LLVM_DELETED_FUNCTION; |
| 47 | DWARFContext &operator=(DWARFContext &) LLVM_DELETED_FUNCTION; |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 48 | |
Alexey Samsonov | 1eabf98 | 2014-03-13 07:52:54 +0000 | [diff] [blame^] | 49 | /// Read compile units from the debug_info section (if necessary) |
| 50 | /// and store them in CUs. |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 51 | void parseCompileUnits(); |
Eric Christopher | 7370b55 | 2012-11-12 21:40:38 +0000 | [diff] [blame] | 52 | |
Alexey Samsonov | 1eabf98 | 2014-03-13 07:52:54 +0000 | [diff] [blame^] | 53 | /// Read type units from the debug_types sections (if necessary) |
| 54 | /// and store them in TUs. |
David Blaikie | 03c089c | 2013-09-23 22:44:47 +0000 | [diff] [blame] | 55 | void parseTypeUnits(); |
| 56 | |
Alexey Samsonov | 1eabf98 | 2014-03-13 07:52:54 +0000 | [diff] [blame^] | 57 | /// Read compile units from the debug_info.dwo section (if necessary) |
| 58 | /// and store them in DWOCUs. |
Eric Christopher | da4b219 | 2013-01-02 23:52:13 +0000 | [diff] [blame] | 59 | void parseDWOCompileUnits(); |
| 60 | |
Alexey Samsonov | 1eabf98 | 2014-03-13 07:52:54 +0000 | [diff] [blame^] | 61 | /// Read type units from the debug_types.dwo section (if necessary) |
| 62 | /// and store them in DWOTUs. |
David Blaikie | 92d9d62 | 2014-01-09 05:08:24 +0000 | [diff] [blame] | 63 | void parseDWOTypeUnits(); |
| 64 | |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 65 | public: |
David Blaikie | 1b5ee5d | 2013-09-23 17:42:01 +0000 | [diff] [blame] | 66 | struct Section { |
| 67 | StringRef Data; |
| 68 | RelocAddrMap Relocs; |
| 69 | }; |
| 70 | |
Alexey Samsonov | c2e0087 | 2013-08-06 10:32:39 +0000 | [diff] [blame] | 71 | DWARFContext() : DIContext(CK_DWARF) {} |
Alexey Samsonov | a9debbf | 2013-08-23 06:56:01 +0000 | [diff] [blame] | 72 | virtual ~DWARFContext(); |
Alexey Samsonov | c2e0087 | 2013-08-06 10:32:39 +0000 | [diff] [blame] | 73 | |
| 74 | static bool classof(const DIContext *DICtx) { |
| 75 | return DICtx->getKind() == CK_DWARF; |
| 76 | } |
| 77 | |
Craig Topper | 8548299 | 2014-03-05 07:52:44 +0000 | [diff] [blame] | 78 | void dump(raw_ostream &OS, DIDumpType DumpType = DIDT_All) override; |
Eric Christopher | 7c678de | 2012-11-07 23:22:07 +0000 | [diff] [blame] | 79 | |
Alexey Samsonov | 1eabf98 | 2014-03-13 07:52:54 +0000 | [diff] [blame^] | 80 | typedef iterator_range<CUVector::iterator> cu_iterator_range; |
| 81 | typedef iterator_range<TUVector::iterator> tu_iterator_range; |
| 82 | |
| 83 | /// Get compile units in this context. |
| 84 | cu_iterator_range compile_units() { |
| 85 | parseCompileUnits(); |
| 86 | return cu_iterator_range(CUs.begin(), CUs.end()); |
| 87 | } |
| 88 | |
| 89 | /// Get type units in this context. |
| 90 | tu_iterator_range type_units() { |
| 91 | parseTypeUnits(); |
| 92 | return tu_iterator_range(TUs.begin(), TUs.end()); |
| 93 | } |
| 94 | |
| 95 | /// Get compile units in the DWO context. |
| 96 | cu_iterator_range dwo_compile_units() { |
| 97 | parseDWOCompileUnits(); |
| 98 | return cu_iterator_range(DWOCUs.begin(), DWOCUs.end()); |
| 99 | } |
| 100 | |
| 101 | /// Get type units in the DWO context. |
| 102 | tu_iterator_range dwo_type_units() { |
| 103 | parseDWOTypeUnits(); |
| 104 | return tu_iterator_range(DWOTUs.begin(), DWOTUs.end()); |
| 105 | } |
| 106 | |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 107 | /// Get the number of compile units in this context. |
| 108 | unsigned getNumCompileUnits() { |
Alexey Samsonov | 1eabf98 | 2014-03-13 07:52:54 +0000 | [diff] [blame^] | 109 | parseCompileUnits(); |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 110 | return CUs.size(); |
| 111 | } |
Eric Christopher | da4b219 | 2013-01-02 23:52:13 +0000 | [diff] [blame] | 112 | |
David Blaikie | 03c089c | 2013-09-23 22:44:47 +0000 | [diff] [blame] | 113 | /// Get the number of compile units in this context. |
| 114 | unsigned getNumTypeUnits() { |
Alexey Samsonov | 1eabf98 | 2014-03-13 07:52:54 +0000 | [diff] [blame^] | 115 | parseTypeUnits(); |
David Blaikie | 03c089c | 2013-09-23 22:44:47 +0000 | [diff] [blame] | 116 | return TUs.size(); |
| 117 | } |
| 118 | |
Eric Christopher | da4b219 | 2013-01-02 23:52:13 +0000 | [diff] [blame] | 119 | /// Get the number of compile units in the DWO context. |
| 120 | unsigned getNumDWOCompileUnits() { |
Alexey Samsonov | 1eabf98 | 2014-03-13 07:52:54 +0000 | [diff] [blame^] | 121 | parseDWOCompileUnits(); |
Eric Christopher | da4b219 | 2013-01-02 23:52:13 +0000 | [diff] [blame] | 122 | return DWOCUs.size(); |
| 123 | } |
| 124 | |
David Blaikie | 92d9d62 | 2014-01-09 05:08:24 +0000 | [diff] [blame] | 125 | /// Get the number of compile units in the DWO context. |
| 126 | unsigned getNumDWOTypeUnits() { |
Alexey Samsonov | 1eabf98 | 2014-03-13 07:52:54 +0000 | [diff] [blame^] | 127 | parseDWOTypeUnits(); |
David Blaikie | 92d9d62 | 2014-01-09 05:08:24 +0000 | [diff] [blame] | 128 | return DWOTUs.size(); |
| 129 | } |
| 130 | |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 131 | /// Get the compile unit at the specified index for this compile unit. |
| 132 | DWARFCompileUnit *getCompileUnitAtIndex(unsigned index) { |
Alexey Samsonov | 1eabf98 | 2014-03-13 07:52:54 +0000 | [diff] [blame^] | 133 | parseCompileUnits(); |
Alexey Samsonov | a9debbf | 2013-08-23 06:56:01 +0000 | [diff] [blame] | 134 | return CUs[index]; |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 135 | } |
| 136 | |
Eric Christopher | da4b219 | 2013-01-02 23:52:13 +0000 | [diff] [blame] | 137 | /// Get the compile unit at the specified index for the DWO compile units. |
| 138 | DWARFCompileUnit *getDWOCompileUnitAtIndex(unsigned index) { |
Alexey Samsonov | 1eabf98 | 2014-03-13 07:52:54 +0000 | [diff] [blame^] | 139 | parseDWOCompileUnits(); |
Alexey Samsonov | a9debbf | 2013-08-23 06:56:01 +0000 | [diff] [blame] | 140 | return DWOCUs[index]; |
Eric Christopher | da4b219 | 2013-01-02 23:52:13 +0000 | [diff] [blame] | 141 | } |
| 142 | |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 143 | /// Get a pointer to the parsed DebugAbbrev object. |
| 144 | const DWARFDebugAbbrev *getDebugAbbrev(); |
| 145 | |
David Blaikie | 18e7350 | 2013-06-19 21:37:13 +0000 | [diff] [blame] | 146 | /// Get a pointer to the parsed DebugLoc object. |
| 147 | const DWARFDebugLoc *getDebugLoc(); |
| 148 | |
Eric Christopher | da4b219 | 2013-01-02 23:52:13 +0000 | [diff] [blame] | 149 | /// Get a pointer to the parsed dwo abbreviations object. |
| 150 | const DWARFDebugAbbrev *getDebugAbbrevDWO(); |
| 151 | |
Benjamin Kramer | a6002fd | 2011-09-14 01:09:52 +0000 | [diff] [blame] | 152 | /// Get a pointer to the parsed DebugAranges object. |
| 153 | const DWARFDebugAranges *getDebugAranges(); |
| 154 | |
Eli Bendersky | fd08bc1 | 2013-02-05 23:30:58 +0000 | [diff] [blame] | 155 | /// Get a pointer to the parsed frame information object. |
| 156 | const DWARFDebugFrame *getDebugFrame(); |
| 157 | |
Benjamin Kramer | 679e175 | 2011-09-15 20:43:18 +0000 | [diff] [blame] | 158 | /// Get a pointer to a parsed line table corresponding to a compile unit. |
| 159 | const DWARFDebugLine::LineTable * |
| 160 | getLineTableForCompileUnit(DWARFCompileUnit *cu); |
Benjamin Kramer | 5acab50 | 2011-09-15 02:12:05 +0000 | [diff] [blame] | 161 | |
Craig Topper | 8548299 | 2014-03-05 07:52:44 +0000 | [diff] [blame] | 162 | DILineInfo getLineInfoForAddress(uint64_t Address, |
| 163 | DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override; |
| 164 | DILineInfoTable getLineInfoForAddressRange(uint64_t Address, uint64_t Size, |
| 165 | DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override; |
| 166 | DIInliningInfo getInliningInfoForAddress(uint64_t Address, |
| 167 | DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override; |
Benjamin Kramer | 2602ca6 | 2011-09-15 20:43:22 +0000 | [diff] [blame] | 168 | |
Eric Christopher | 7370b55 | 2012-11-12 21:40:38 +0000 | [diff] [blame] | 169 | virtual bool isLittleEndian() const = 0; |
Eli Bendersky | fd08bc1 | 2013-02-05 23:30:58 +0000 | [diff] [blame] | 170 | virtual uint8_t getAddressSize() const = 0; |
David Blaikie | 1b5ee5d | 2013-09-23 17:42:01 +0000 | [diff] [blame] | 171 | virtual const Section &getInfoSection() = 0; |
David Blaikie | bc56327 | 2013-12-13 21:33:40 +0000 | [diff] [blame] | 172 | typedef MapVector<object::SectionRef, Section, |
| 173 | std::map<object::SectionRef, unsigned> > TypeSectionMap; |
| 174 | virtual const TypeSectionMap &getTypesSections() = 0; |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 175 | virtual StringRef getAbbrevSection() = 0; |
David Blaikie | 1b5ee5d | 2013-09-23 17:42:01 +0000 | [diff] [blame] | 176 | virtual const Section &getLocSection() = 0; |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 177 | virtual StringRef getARangeSection() = 0; |
Eli Bendersky | fd08bc1 | 2013-02-05 23:30:58 +0000 | [diff] [blame] | 178 | virtual StringRef getDebugFrameSection() = 0; |
David Blaikie | 1b5ee5d | 2013-09-23 17:42:01 +0000 | [diff] [blame] | 179 | virtual const Section &getLineSection() = 0; |
David Blaikie | 1d4736e | 2014-02-24 23:58:54 +0000 | [diff] [blame] | 180 | virtual const Section &getLineDWOSection() = 0; |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 181 | virtual StringRef getStringSection() = 0; |
Alexey Samsonov | 034e57a | 2012-08-27 07:17:47 +0000 | [diff] [blame] | 182 | virtual StringRef getRangeSection() = 0; |
Krzysztof Parzyszek | 97438dc | 2013-02-12 16:20:28 +0000 | [diff] [blame] | 183 | virtual StringRef getPubNamesSection() = 0; |
Eric Christopher | 4c7e6ba | 2013-09-25 23:02:41 +0000 | [diff] [blame] | 184 | virtual StringRef getPubTypesSection() = 0; |
David Blaikie | 404d304 | 2013-09-19 23:01:29 +0000 | [diff] [blame] | 185 | virtual StringRef getGnuPubNamesSection() = 0; |
David Blaikie | ecd21ff | 2013-09-24 19:50:00 +0000 | [diff] [blame] | 186 | virtual StringRef getGnuPubTypesSection() = 0; |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 187 | |
Eric Christopher | da4b219 | 2013-01-02 23:52:13 +0000 | [diff] [blame] | 188 | // Sections for DWARF5 split dwarf proposal. |
David Blaikie | 1b5ee5d | 2013-09-23 17:42:01 +0000 | [diff] [blame] | 189 | virtual const Section &getInfoDWOSection() = 0; |
David Blaikie | 92d9d62 | 2014-01-09 05:08:24 +0000 | [diff] [blame] | 190 | virtual const TypeSectionMap &getTypesDWOSections() = 0; |
Eric Christopher | da4b219 | 2013-01-02 23:52:13 +0000 | [diff] [blame] | 191 | virtual StringRef getAbbrevDWOSection() = 0; |
| 192 | virtual StringRef getStringDWOSection() = 0; |
Eric Christopher | 2cbd576 | 2013-01-07 19:32:41 +0000 | [diff] [blame] | 193 | virtual StringRef getStringOffsetDWOSection() = 0; |
Eric Christopher | da4b219 | 2013-01-02 23:52:13 +0000 | [diff] [blame] | 194 | virtual StringRef getRangeDWOSection() = 0; |
Eric Christopher | 962c908 | 2013-01-15 23:56:56 +0000 | [diff] [blame] | 195 | virtual StringRef getAddrSection() = 0; |
Eric Christopher | da4b219 | 2013-01-02 23:52:13 +0000 | [diff] [blame] | 196 | |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 197 | static bool isSupportedVersion(unsigned version) { |
Eric Christopher | f7d848d | 2013-08-06 01:38:27 +0000 | [diff] [blame] | 198 | return version == 2 || version == 3 || version == 4; |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 199 | } |
Alexey Samsonov | 45be793 | 2012-08-30 07:49:50 +0000 | [diff] [blame] | 200 | private: |
| 201 | /// Return the compile unit that includes an offset (relative to .debug_info). |
| 202 | DWARFCompileUnit *getCompileUnitForOffset(uint32_t Offset); |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 203 | |
Alexey Samsonov | 45be793 | 2012-08-30 07:49:50 +0000 | [diff] [blame] | 204 | /// Return the compile unit which contains instruction with provided |
| 205 | /// address. |
| 206 | DWARFCompileUnit *getCompileUnitForAddress(uint64_t Address); |
Alexey Samsonov | 45be793 | 2012-08-30 07:49:50 +0000 | [diff] [blame] | 207 | }; |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 208 | |
| 209 | /// DWARFContextInMemory is the simplest possible implementation of a |
| 210 | /// DWARFContext. It assumes all content is available in memory and stores |
| 211 | /// pointers to it. |
| 212 | class DWARFContextInMemory : public DWARFContext { |
David Blaikie | a379b181 | 2011-12-20 02:50:00 +0000 | [diff] [blame] | 213 | virtual void anchor(); |
Eric Christopher | 7370b55 | 2012-11-12 21:40:38 +0000 | [diff] [blame] | 214 | bool IsLittleEndian; |
Eli Bendersky | fd08bc1 | 2013-02-05 23:30:58 +0000 | [diff] [blame] | 215 | uint8_t AddressSize; |
David Blaikie | 1b5ee5d | 2013-09-23 17:42:01 +0000 | [diff] [blame] | 216 | Section InfoSection; |
David Blaikie | bc56327 | 2013-12-13 21:33:40 +0000 | [diff] [blame] | 217 | TypeSectionMap TypesSections; |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 218 | StringRef AbbrevSection; |
David Blaikie | 1b5ee5d | 2013-09-23 17:42:01 +0000 | [diff] [blame] | 219 | Section LocSection; |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 220 | StringRef ARangeSection; |
Eli Bendersky | fd08bc1 | 2013-02-05 23:30:58 +0000 | [diff] [blame] | 221 | StringRef DebugFrameSection; |
David Blaikie | 1b5ee5d | 2013-09-23 17:42:01 +0000 | [diff] [blame] | 222 | Section LineSection; |
David Blaikie | 1d4736e | 2014-02-24 23:58:54 +0000 | [diff] [blame] | 223 | Section LineDWOSection; |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 224 | StringRef StringSection; |
Alexey Samsonov | 034e57a | 2012-08-27 07:17:47 +0000 | [diff] [blame] | 225 | StringRef RangeSection; |
Krzysztof Parzyszek | 97438dc | 2013-02-12 16:20:28 +0000 | [diff] [blame] | 226 | StringRef PubNamesSection; |
Eric Christopher | 4c7e6ba | 2013-09-25 23:02:41 +0000 | [diff] [blame] | 227 | StringRef PubTypesSection; |
David Blaikie | 404d304 | 2013-09-19 23:01:29 +0000 | [diff] [blame] | 228 | StringRef GnuPubNamesSection; |
David Blaikie | ecd21ff | 2013-09-24 19:50:00 +0000 | [diff] [blame] | 229 | StringRef GnuPubTypesSection; |
Eric Christopher | da4b219 | 2013-01-02 23:52:13 +0000 | [diff] [blame] | 230 | |
| 231 | // Sections for DWARF5 split dwarf proposal. |
David Blaikie | 1b5ee5d | 2013-09-23 17:42:01 +0000 | [diff] [blame] | 232 | Section InfoDWOSection; |
David Blaikie | 92d9d62 | 2014-01-09 05:08:24 +0000 | [diff] [blame] | 233 | TypeSectionMap TypesDWOSections; |
Eric Christopher | da4b219 | 2013-01-02 23:52:13 +0000 | [diff] [blame] | 234 | StringRef AbbrevDWOSection; |
| 235 | StringRef StringDWOSection; |
Eric Christopher | 2cbd576 | 2013-01-07 19:32:41 +0000 | [diff] [blame] | 236 | StringRef StringOffsetDWOSection; |
Eric Christopher | da4b219 | 2013-01-02 23:52:13 +0000 | [diff] [blame] | 237 | StringRef RangeDWOSection; |
Eric Christopher | 962c908 | 2013-01-15 23:56:56 +0000 | [diff] [blame] | 238 | StringRef AddrSection; |
Eric Christopher | da4b219 | 2013-01-02 23:52:13 +0000 | [diff] [blame] | 239 | |
Alexey Samsonov | 068fc8a | 2013-04-23 10:17:34 +0000 | [diff] [blame] | 240 | SmallVector<MemoryBuffer*, 4> UncompressedSections; |
| 241 | |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 242 | public: |
Eric Christopher | 7370b55 | 2012-11-12 21:40:38 +0000 | [diff] [blame] | 243 | DWARFContextInMemory(object::ObjectFile *); |
Alexey Samsonov | 068fc8a | 2013-04-23 10:17:34 +0000 | [diff] [blame] | 244 | ~DWARFContextInMemory(); |
Craig Topper | 8548299 | 2014-03-05 07:52:44 +0000 | [diff] [blame] | 245 | bool isLittleEndian() const override { return IsLittleEndian; } |
| 246 | uint8_t getAddressSize() const override { return AddressSize; } |
| 247 | const Section &getInfoSection() override { return InfoSection; } |
| 248 | const TypeSectionMap &getTypesSections() override { return TypesSections; } |
| 249 | StringRef getAbbrevSection() override { return AbbrevSection; } |
| 250 | const Section &getLocSection() override { return LocSection; } |
| 251 | StringRef getARangeSection() override { return ARangeSection; } |
| 252 | StringRef getDebugFrameSection() override { return DebugFrameSection; } |
| 253 | const Section &getLineSection() override { return LineSection; } |
| 254 | const Section &getLineDWOSection() override { return LineDWOSection; } |
| 255 | StringRef getStringSection() override { return StringSection; } |
| 256 | StringRef getRangeSection() override { return RangeSection; } |
| 257 | StringRef getPubNamesSection() override { return PubNamesSection; } |
| 258 | StringRef getPubTypesSection() override { return PubTypesSection; } |
| 259 | StringRef getGnuPubNamesSection() override { return GnuPubNamesSection; } |
| 260 | StringRef getGnuPubTypesSection() override { return GnuPubTypesSection; } |
Eric Christopher | da4b219 | 2013-01-02 23:52:13 +0000 | [diff] [blame] | 261 | |
| 262 | // Sections for DWARF5 split dwarf proposal. |
Craig Topper | 8548299 | 2014-03-05 07:52:44 +0000 | [diff] [blame] | 263 | const Section &getInfoDWOSection() override { return InfoDWOSection; } |
| 264 | const TypeSectionMap &getTypesDWOSections() override { |
David Blaikie | 92d9d62 | 2014-01-09 05:08:24 +0000 | [diff] [blame] | 265 | return TypesDWOSections; |
| 266 | } |
Craig Topper | 8548299 | 2014-03-05 07:52:44 +0000 | [diff] [blame] | 267 | StringRef getAbbrevDWOSection() override { return AbbrevDWOSection; } |
| 268 | StringRef getStringDWOSection() override { return StringDWOSection; } |
| 269 | StringRef getStringOffsetDWOSection() override { |
Eric Christopher | 2cbd576 | 2013-01-07 19:32:41 +0000 | [diff] [blame] | 270 | return StringOffsetDWOSection; |
| 271 | } |
Craig Topper | 8548299 | 2014-03-05 07:52:44 +0000 | [diff] [blame] | 272 | StringRef getRangeDWOSection() override { return RangeDWOSection; } |
| 273 | StringRef getAddrSection() override { |
Eric Christopher | 962c908 | 2013-01-15 23:56:56 +0000 | [diff] [blame] | 274 | return AddrSection; |
| 275 | } |
Benjamin Kramer | aa2f78f | 2011-09-13 19:42:23 +0000 | [diff] [blame] | 276 | }; |
| 277 | |
| 278 | } |
| 279 | |
| 280 | #endif |