LLVM  5.0.0
DWARFContext.h
Go to the documentation of this file.
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_DWARF_DWARFCONTEXT_H
11 #define LLVM_DEBUGINFO_DWARF_DWARFCONTEXT_H
12 
13 #include "llvm/ADT/MapVector.h"
14 #include "llvm/ADT/SmallString.h"
15 #include "llvm/ADT/SmallVector.h"
16 #include "llvm/ADT/StringMap.h"
17 #include "llvm/ADT/StringRef.h"
33 #include "llvm/Object/Binary.h"
34 #include "llvm/Object/ObjectFile.h"
35 #include "llvm/Support/Error.h"
36 #include "llvm/Support/Host.h"
37 #include <cstdint>
38 #include <deque>
39 #include <map>
40 #include <memory>
41 
42 namespace llvm {
43 
44 class DataExtractor;
45 class MemoryBuffer;
46 class raw_ostream;
47 
48 /// DWARFContext
49 /// This data structure is the top level entity that deals with dwarf debug
50 /// information parsing. The actual data is supplied through pure virtual
51 /// methods that a concrete implementation provides.
52 class DWARFContext : public DIContext {
54  std::deque<DWARFUnitSection<DWARFTypeUnit>> TUs;
55  std::unique_ptr<DWARFUnitIndex> CUIndex;
56  std::unique_ptr<DWARFGdbIndex> GdbIndex;
57  std::unique_ptr<DWARFUnitIndex> TUIndex;
58  std::unique_ptr<DWARFDebugAbbrev> Abbrev;
59  std::unique_ptr<DWARFDebugLoc> Loc;
60  std::unique_ptr<DWARFDebugAranges> Aranges;
61  std::unique_ptr<DWARFDebugLine> Line;
62  std::unique_ptr<DWARFDebugFrame> DebugFrame;
63  std::unique_ptr<DWARFDebugFrame> EHFrame;
64  std::unique_ptr<DWARFDebugMacro> Macro;
65 
67  std::deque<DWARFUnitSection<DWARFTypeUnit>> DWOTUs;
68  std::unique_ptr<DWARFDebugAbbrev> AbbrevDWO;
69  std::unique_ptr<DWARFDebugLocDWO> LocDWO;
70 
71  /// The maximum DWARF version of all units.
72  unsigned MaxVersion = 0;
73 
74  struct DWOFile {
76  std::unique_ptr<DWARFContext> Context;
77  };
79  std::weak_ptr<DWOFile> DWP;
80  bool CheckedForDWP = false;
81 
82  /// Read compile units from the debug_info section (if necessary)
83  /// and store them in CUs.
84  void parseCompileUnits();
85 
86  /// Read type units from the debug_types sections (if necessary)
87  /// and store them in TUs.
88  void parseTypeUnits();
89 
90  /// Read compile units from the debug_info.dwo section (if necessary)
91  /// and store them in DWOCUs.
92  void parseDWOCompileUnits();
93 
94  /// Read type units from the debug_types.dwo section (if necessary)
95  /// and store them in DWOTUs.
96  void parseDWOTypeUnits();
97 
98 public:
100  DWARFContext(DWARFContext &) = delete;
101  DWARFContext &operator=(DWARFContext &) = delete;
102 
103  static bool classof(const DIContext *DICtx) {
104  return DICtx->getKind() == CK_DWARF;
105  }
106 
107  void dump(raw_ostream &OS, DIDumpOptions DumpOpts) override;
108 
109  bool verify(raw_ostream &OS, DIDumpType DumpType = DIDT_All) override;
110 
114 
115  /// Get compile units in this context.
117  parseCompileUnits();
118  return cu_iterator_range(CUs.begin(), CUs.end());
119  }
120 
121  /// Get type units in this context.
123  parseTypeUnits();
124  return tu_section_iterator_range(TUs.begin(), TUs.end());
125  }
126 
127  /// Get compile units in the DWO context.
129  parseDWOCompileUnits();
130  return cu_iterator_range(DWOCUs.begin(), DWOCUs.end());
131  }
132 
133  /// Get type units in the DWO context.
135  parseDWOTypeUnits();
136  return tu_section_iterator_range(DWOTUs.begin(), DWOTUs.end());
137  }
138 
139  /// Get the number of compile units in this context.
140  unsigned getNumCompileUnits() {
141  parseCompileUnits();
142  return CUs.size();
143  }
144 
145  /// Get the number of compile units in this context.
146  unsigned getNumTypeUnits() {
147  parseTypeUnits();
148  return TUs.size();
149  }
150 
151  /// Get the number of compile units in the DWO context.
153  parseDWOCompileUnits();
154  return DWOCUs.size();
155  }
156 
157  /// Get the number of compile units in the DWO context.
158  unsigned getNumDWOTypeUnits() {
159  parseDWOTypeUnits();
160  return DWOTUs.size();
161  }
162 
163  /// Get the compile unit at the specified index for this compile unit.
165  parseCompileUnits();
166  return CUs[index].get();
167  }
168 
169  /// Get the compile unit at the specified index for the DWO compile units.
171  parseDWOCompileUnits();
172  return DWOCUs[index].get();
173  }
174 
176 
177  /// Get a DIE given an exact offset.
179 
180  unsigned getMaxVersion() const { return MaxVersion; }
181 
183  if (Version > MaxVersion)
184  MaxVersion = Version;
185  }
186 
187  const DWARFUnitIndex &getCUIndex();
189  const DWARFUnitIndex &getTUIndex();
190 
191  /// Get a pointer to the parsed DebugAbbrev object.
193 
194  /// Get a pointer to the parsed DebugLoc object.
195  const DWARFDebugLoc *getDebugLoc();
196 
197  /// Get a pointer to the parsed dwo abbreviations object.
199 
200  /// Get a pointer to the parsed DebugLoc object.
202 
203  /// Get a pointer to the parsed DebugAranges object.
205 
206  /// Get a pointer to the parsed frame information object.
208 
209  /// Get a pointer to the parsed eh frame information object.
210  const DWARFDebugFrame *getEHFrame();
211 
212  /// Get a pointer to the parsed DebugMacro object.
214 
215  /// Get a pointer to a parsed line table corresponding to a compile unit.
217 
219  DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
220  DILineInfoTable getLineInfoForAddressRange(uint64_t Address, uint64_t Size,
221  DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
222  DIInliningInfo getInliningInfoForAddress(uint64_t Address,
223  DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
224 
225  virtual StringRef getFileName() const = 0;
226  virtual bool isLittleEndian() const = 0;
227  virtual uint8_t getAddressSize() const = 0;
228  virtual const DWARFSection &getInfoSection() = 0;
229  virtual void forEachTypesSections(function_ref<void(DWARFSection &)> F) = 0;
230  virtual StringRef getAbbrevSection() = 0;
231  virtual const DWARFSection &getLocSection() = 0;
232  virtual StringRef getARangeSection() = 0;
233  virtual StringRef getDebugFrameSection() = 0;
234  virtual StringRef getEHFrameSection() = 0;
235  virtual const DWARFSection &getLineSection() = 0;
236  virtual StringRef getStringSection() = 0;
237  virtual const DWARFSection& getRangeSection() = 0;
238  virtual StringRef getMacinfoSection() = 0;
239  virtual StringRef getPubNamesSection() = 0;
240  virtual StringRef getPubTypesSection() = 0;
241  virtual StringRef getGnuPubNamesSection() = 0;
242  virtual StringRef getGnuPubTypesSection() = 0;
243 
244  /// DWARF v5
245  /// @{
246  virtual const DWARFSection &getStringOffsetSection() = 0;
247  /// @}
248 
249  // Sections for DWARF5 split dwarf proposal.
250  virtual const DWARFSection &getInfoDWOSection() = 0;
251  virtual void
253  virtual StringRef getAbbrevDWOSection() = 0;
254  virtual const DWARFSection &getLineDWOSection() = 0;
255  virtual const DWARFSection &getLocDWOSection() = 0;
256  virtual StringRef getStringDWOSection() = 0;
257  virtual const DWARFSection &getStringOffsetDWOSection() = 0;
258  virtual const DWARFSection &getRangeDWOSection() = 0;
259  virtual const DWARFSection &getAddrSection() = 0;
260  virtual const DWARFSection& getAppleNamesSection() = 0;
261  virtual const DWARFSection& getAppleTypesSection() = 0;
262  virtual const DWARFSection& getAppleNamespacesSection() = 0;
263  virtual const DWARFSection& getAppleObjCSection() = 0;
264  virtual StringRef getCUIndexSection() = 0;
265  virtual StringRef getGdbIndexSection() = 0;
266  virtual StringRef getTUIndexSection() = 0;
267 
268  static bool isSupportedVersion(unsigned version) {
269  return version == 2 || version == 3 || version == 4 || version == 5;
270  }
271 
272  std::shared_ptr<DWARFContext> getDWOContext(StringRef AbsolutePath);
273 
274 private:
275  /// Return the compile unit that includes an offset (relative to .debug_info).
276  DWARFCompileUnit *getCompileUnitForOffset(uint32_t Offset);
277 
278  /// Return the compile unit which contains instruction with provided
279  /// address.
280  DWARFCompileUnit *getCompileUnitForAddress(uint64_t Address);
281 };
282 
283 /// Used as a return value for a error callback passed to DWARF context.
284 /// Callback should return Halt if client application wants to stop
285 /// object parsing, or should return Continue otherwise.
286 enum class ErrorPolicy { Halt, Continue };
287 
288 /// DWARFContextInMemory is the simplest possible implementation of a
289 /// DWARFContext. It assumes all content is available in memory and stores
290 /// pointers to it.
292  virtual void anchor();
293 
294  using TypeSectionMap = MapVector<object::SectionRef, DWARFSection,
295  std::map<object::SectionRef, unsigned>>;
296 
297  StringRef FileName;
298  bool IsLittleEndian;
299  uint8_t AddressSize;
300  DWARFSection InfoSection;
301  TypeSectionMap TypesSections;
302  StringRef AbbrevSection;
303  DWARFSection LocSection;
304  StringRef ARangeSection;
305  StringRef DebugFrameSection;
306  StringRef EHFrameSection;
307  DWARFSection LineSection;
308  StringRef StringSection;
309  DWARFSection RangeSection;
310  StringRef MacinfoSection;
311  StringRef PubNamesSection;
312  StringRef PubTypesSection;
313  StringRef GnuPubNamesSection;
314  StringRef GnuPubTypesSection;
315 
316  /// DWARF v5
317  /// @{
318  DWARFSection StringOffsetSection;
319  /// @}
320 
321  // Sections for DWARF5 split dwarf proposal.
322  DWARFSection InfoDWOSection;
323  TypeSectionMap TypesDWOSections;
324  StringRef AbbrevDWOSection;
325  DWARFSection LineDWOSection;
326  DWARFSection LocDWOSection;
327  StringRef StringDWOSection;
328  DWARFSection StringOffsetDWOSection;
329  DWARFSection RangeDWOSection;
330  DWARFSection AddrSection;
331  DWARFSection AppleNamesSection;
332  DWARFSection AppleTypesSection;
333  DWARFSection AppleNamespacesSection;
334  DWARFSection AppleObjCSection;
335  StringRef CUIndexSection;
336  StringRef GdbIndexSection;
337  StringRef TUIndexSection;
338 
339  SmallVector<SmallString<32>, 4> UncompressedSections;
340 
341  DWARFSection *mapNameToDWARFSection(StringRef Name);
342  StringRef *mapSectionToMember(StringRef Name);
343 
344  /// If Sec is compressed section, decompresses and updates its contents
345  /// provided by Data. Otherwise leaves it unchanged.
346  Error maybeDecompress(const object::SectionRef &Sec, StringRef Name,
347  StringRef &Data);
348 
349  /// Function used to handle default error reporting policy. Prints a error
350  /// message and returns Continue, so DWARF context ignores the error.
351  static ErrorPolicy defaultErrorHandler(Error E);
352 
353 public:
355  const object::ObjectFile &Obj, const LoadedObjectInfo *L = nullptr,
356  function_ref<ErrorPolicy(Error)> HandleError = defaultErrorHandler);
357 
358  DWARFContextInMemory(const StringMap<std::unique_ptr<MemoryBuffer>> &Sections,
359  uint8_t AddrSize,
361 
362  StringRef getFileName() const override { return FileName; }
363  bool isLittleEndian() const override { return IsLittleEndian; }
364  uint8_t getAddressSize() const override { return AddressSize; }
365  const DWARFSection &getInfoSection() override { return InfoSection; }
367  for (auto &P : TypesSections)
368  F(P.second);
369  }
370  StringRef getAbbrevSection() override { return AbbrevSection; }
371  const DWARFSection &getLocSection() override { return LocSection; }
372  StringRef getARangeSection() override { return ARangeSection; }
373  StringRef getDebugFrameSection() override { return DebugFrameSection; }
374  StringRef getEHFrameSection() override { return EHFrameSection; }
375  const DWARFSection &getLineSection() override { return LineSection; }
376  StringRef getStringSection() override { return StringSection; }
377  const DWARFSection &getRangeSection() override { return RangeSection; }
378  StringRef getMacinfoSection() override { return MacinfoSection; }
379  StringRef getPubNamesSection() override { return PubNamesSection; }
380  StringRef getPubTypesSection() override { return PubTypesSection; }
381  StringRef getGnuPubNamesSection() override { return GnuPubNamesSection; }
382  StringRef getGnuPubTypesSection() override { return GnuPubTypesSection; }
383  const DWARFSection& getAppleNamesSection() override { return AppleNamesSection; }
384  const DWARFSection& getAppleTypesSection() override { return AppleTypesSection; }
385  const DWARFSection& getAppleNamespacesSection() override { return AppleNamespacesSection; }
386  const DWARFSection& getAppleObjCSection() override { return AppleObjCSection; }
387 
388  // DWARF v5
390  return StringOffsetSection;
391  }
392 
393  // Sections for DWARF5 split dwarf proposal.
394  const DWARFSection &getInfoDWOSection() override { return InfoDWOSection; }
395 
397  for (auto &P : TypesDWOSections)
398  F(P.second);
399  }
400 
401  StringRef getAbbrevDWOSection() override { return AbbrevDWOSection; }
402  const DWARFSection &getLineDWOSection() override { return LineDWOSection; }
403  const DWARFSection &getLocDWOSection() override { return LocDWOSection; }
404  StringRef getStringDWOSection() override { return StringDWOSection; }
405 
407  return StringOffsetDWOSection;
408  }
409 
410  const DWARFSection &getRangeDWOSection() override { return RangeDWOSection; }
411 
412  const DWARFSection &getAddrSection() override { return AddrSection; }
413 
414  StringRef getCUIndexSection() override { return CUIndexSection; }
415  StringRef getGdbIndexSection() override { return GdbIndexSection; }
416  StringRef getTUIndexSection() override { return TUIndexSection; }
417 };
418 
419 } // end namespace llvm
420 
421 #endif // LLVM_DEBUGINFO_DWARF_DWARFCONTEXT_H
MachineLoop * L
const DWARFUnitIndex & getTUIndex()
virtual StringRef getAbbrevSection()=0
StringRef getPubTypesSection() override
Definition: DWARFContext.h:380
DWARFCompileUnit * getDWOCompileUnitAtIndex(unsigned index)
Get the compile unit at the specified index for the DWO compile units.
Definition: DWARFContext.h:170
const DWARFDebugFrame * getEHFrame()
Get a pointer to the parsed eh frame information object.
StringRef getGdbIndexSection() override
Definition: DWARFContext.h:415
const DWARFDebugFrame * getDebugFrame()
Get a pointer to the parsed frame information object.
StringRef getEHFrameSection() override
Definition: DWARFContext.h:374
LLVMContext & Context
StringRef getTUIndexSection() override
Definition: DWARFContext.h:416
A parsed .debug_frame or .eh_frame section.
const DWARFDebugLocDWO * getDebugLocDWO()
Get a pointer to the parsed DebugLoc object.
StringRef getDebugFrameSection() override
Definition: DWARFContext.h:373
const DWARFDebugLoc * getDebugLoc()
Get a pointer to the parsed DebugLoc object.
const DWARFSection & getRangeSection() override
Definition: DWARFContext.h:377
ErrorPolicy
Used as a return value for a error callback passed to DWARF context.
Definition: DWARFContext.h:286
DWARFDie getDIEForOffset(uint32_t Offset)
Get a DIE given an exact offset.
virtual const DWARFSection & getLineSection()=0
virtual const DWARFSection & getAppleTypesSection()=0
This provides a very simple, boring adaptor for a begin and end iterator into a range type...
DWARFGdbIndex & getGdbIndex()
std::shared_ptr< DWARFContext > getDWOContext(StringRef AbsolutePath)
unsigned getNumDWOCompileUnits()
Get the number of compile units in the DWO context.
Definition: DWARFContext.h:152
virtual StringRef getFileName() const =0
An efficient, type-erasing, non-owning reference to a callable.
Definition: STLExtras.h:89
StringRef getFileName() const override
Definition: DWARFContext.h:362
This class is the base class for all object file types.
Definition: ObjectFile.h:189
This class implements a map that also provides access to all stored values in a deterministic order...
Definition: MapVector.h:38
unsigned getNumTypeUnits()
Get the number of compile units in this context.
Definition: DWARFContext.h:146
const DWARFDebugAbbrev * getDebugAbbrevDWO()
Get a pointer to the parsed dwo abbreviations object.
virtual StringRef getStringDWOSection()=0
virtual uint8_t getAddressSize() const =0
virtual const DWARFSection & getAppleNamesSection()=0
bool isLittleEndian() const override
Definition: DWARFContext.h:363
virtual const DWARFSection & getInfoDWOSection()=0
virtual const DWARFSection & getRangeDWOSection()=0
const DWARFSection & getLocSection() override
Definition: DWARFContext.h:371
virtual const DWARFSection & getAppleObjCSection()=0
StringRef getGnuPubTypesSection() override
Definition: DWARFContext.h:382
virtual StringRef getGnuPubTypesSection()=0
DILineInfo - a format-neutral container for source line information.
Definition: DIContext.h:32
DIContextKind getKind() const
Definition: DIContext.h:169
const DWARFSection & getInfoDWOSection() override
Definition: DWARFContext.h:394
StringRef getARangeSection() override
Definition: DWARFContext.h:372
StringRef getMacinfoSection() override
Definition: DWARFContext.h:378
virtual const DWARFSection & getLocSection()=0
unsigned getNumCompileUnits()
Get the number of compile units in this context.
Definition: DWARFContext.h:140
unsigned getMaxVersion() const
Definition: DWARFContext.h:180
virtual StringRef getPubTypesSection()=0
unsigned getNumDWOTypeUnits()
Get the number of compile units in the DWO context.
Definition: DWARFContext.h:158
StringRef getGnuPubNamesSection() override
Definition: DWARFContext.h:381
const DWARFSection & getLocDWOSection() override
Definition: DWARFContext.h:403
static const bool IsLittleEndianHost
Definition: Host.h:51
#define F(x, y, z)
Definition: MD5.cpp:55
const DWARFDebugAranges * getDebugAranges()
Get a pointer to the parsed DebugAranges object.
const DWARFDebugAbbrev * getDebugAbbrev()
Get a pointer to the parsed DebugAbbrev object.
DWARFCompileUnit * getCompileUnitAtIndex(unsigned index)
Get the compile unit at the specified index for this compile unit.
Definition: DWARFContext.h:164
DWARFContextInMemory is the simplest possible implementation of a DWARFContext.
Definition: DWARFContext.h:291
StringRef getAbbrevDWOSection() override
Definition: DWARFContext.h:401
const char * Name
StringRef getAbbrevSection() override
Definition: DWARFContext.h:370
virtual const DWARFSection & getStringOffsetDWOSection()=0
virtual StringRef getCUIndexSection()=0
Container for dump options that control which debug information will be dumped.
Definition: DIContext.h:152
#define P(N)
Utility class that carries the DWARF compile/type unit and the debug info entry in an object...
Definition: DWARFDie.h:43
virtual StringRef getPubNamesSection()=0
DWARFUnitSection< DWARFCompileUnit >::iterator_range cu_iterator_range
Definition: DWARFContext.h:111
DILineInfoSpecifier - controls which fields of DILineInfo container should be filled with data...
Definition: DIContext.h:103
const DWARFDebugMacro * getDebugMacro()
Get a pointer to the parsed DebugMacro object.
DIInliningInfo - a format-neutral container for inlined code description.
Definition: DIContext.h:63
DIDumpType
Selects which debug sections get dumped.
Definition: DIContext.h:116
DILineInfo getLineInfoForAddress(uint64_t Address, DILineInfoSpecifier Specifier=DILineInfoSpecifier()) override
StringRef getCUIndexSection() override
Definition: DWARFContext.h:414
const DWARFSection & getAppleNamespacesSection() override
Definition: DWARFContext.h:385
virtual const DWARFSection & getAddrSection()=0
const DWARFSection & getStringOffsetSection() override
DWARF v5.
Definition: DWARFContext.h:389
StringRef getStringSection() override
Definition: DWARFContext.h:376
virtual void forEachTypesDWOSections(function_ref< void(DWARFSection &)> F)=0
const DWARFSection & getRangeDWOSection() override
Definition: DWARFContext.h:410
DWARFContextInMemory(const object::ObjectFile &Obj, const LoadedObjectInfo *L=nullptr, function_ref< ErrorPolicy(Error)> HandleError=defaultErrorHandler)
const DWARFSection & getAppleTypesSection() override
Definition: DWARFContext.h:384
bool verify(raw_ostream &OS, DIDumpType DumpType=DIDT_All) override
DWARFCompileUnit * getDWOCompileUnitForHash(uint64_t Hash)
#define E
Definition: LargeTest.cpp:27
iterator_range< decltype(TUs)::iterator > tu_section_iterator_range
Definition: DWARFContext.h:113
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Definition: SmallVector.h:861
Concrete instance of DWARFUnitSection, specialized for one Unit type.
Definition: DWARFUnit.h:70
DIInliningInfo getInliningInfoForAddress(uint64_t Address, DILineInfoSpecifier Specifier=DILineInfoSpecifier()) override
DWARFContext This data structure is the top level entity that deals with dwarf debug information pars...
Definition: DWARFContext.h:52
const DWARFSection & getLineDWOSection() override
Definition: DWARFContext.h:402
tu_section_iterator_range dwo_type_unit_sections()
Get type units in the DWO context.
Definition: DWARFContext.h:134
StringRef getPubNamesSection() override
Definition: DWARFContext.h:379
A range adaptor for a pair of iterators.
StringMap - This is an unconventional map that is specialized for handling keys that are "strings"...
Definition: StringMap.h:220
virtual void forEachTypesSections(function_ref< void(DWARFSection &)> F)=0
An inferface for inquiring the load address of a loaded object file to be used by the DIContext imple...
Definition: DIContext.h:192
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
void forEachTypesSections(function_ref< void(DWARFSection &)> F) override
Definition: DWARFContext.h:366
DILineInfoTable getLineInfoForAddressRange(uint64_t Address, uint64_t Size, DILineInfoSpecifier Specifier=DILineInfoSpecifier()) override
virtual const DWARFSection & getInfoSection()=0
virtual StringRef getAbbrevDWOSection()=0
static bool isSupportedVersion(unsigned version)
Definition: DWARFContext.h:268
const DWARFSection & getStringOffsetDWOSection() override
Definition: DWARFContext.h:406
StringRef getStringDWOSection() override
Definition: DWARFContext.h:404
cu_iterator_range compile_units()
Get compile units in this context.
Definition: DWARFContext.h:116
virtual StringRef getGdbIndexSection()=0
void forEachTypesDWOSections(function_ref< void(DWARFSection &)> F) override
Definition: DWARFContext.h:396
const DWARFSection & getInfoSection() override
Definition: DWARFContext.h:365
virtual const DWARFSection & getStringOffsetSection()=0
DWARF v5.
virtual StringRef getARangeSection()=0
static bool classof(const DIContext *DICtx)
Definition: DWARFContext.h:103
const DWARFUnitIndex & getCUIndex()
const DWARFSection & getAddrSection() override
Definition: DWARFContext.h:412
cu_iterator_range dwo_compile_units()
Get compile units in the DWO context.
Definition: DWARFContext.h:128
virtual const DWARFSection & getLineDWOSection()=0
virtual const DWARFSection & getAppleNamespacesSection()=0
const DWARFDebugLine::LineTable * getLineTableForUnit(DWARFUnit *cu)
Get a pointer to a parsed line table corresponding to a compile unit.
Lightweight error class with error context and mandatory checking.
Definition: Error.h:156
virtual const DWARFSection & getLocDWOSection()=0
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:44
std::string Hash(const Unit &U)
Definition: FuzzerSHA1.cpp:216
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
virtual StringRef getStringSection()=0
const DWARFSection & getLineSection() override
Definition: DWARFContext.h:375
tu_section_iterator_range type_unit_sections()
Get type units in this context.
Definition: DWARFContext.h:122
virtual StringRef getMacinfoSection()=0
virtual StringRef getDebugFrameSection()=0
virtual StringRef getGnuPubNamesSection()=0
void dump(raw_ostream &OS, DIDumpOptions DumpOpts) override
virtual StringRef getEHFrameSection()=0
DWARFContext & operator=(DWARFContext &)=delete
virtual StringRef getTUIndexSection()=0
const uint64_t Version
Definition: InstrProf.h:864
virtual const DWARFSection & getRangeSection()=0
void setMaxVersionIfGreater(unsigned Version)
Definition: DWARFContext.h:182
virtual bool isLittleEndian() const =0
const DWARFSection & getAppleNamesSection() override
Definition: DWARFContext.h:383
const DWARFSection & getAppleObjCSection() override
Definition: DWARFContext.h:386
This is a value type class that represents a single section in the list of sections in the object fil...
Definition: ObjectFile.h:81
uint8_t getAddressSize() const override
Definition: DWARFContext.h:364