LLVM  7.0.0svn
DWARFUnit.h
Go to the documentation of this file.
1 //===- DWARFUnit.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_DWARFUNIT_H
11 #define LLVM_DEBUGINFO_DWARF_DWARFUNIT_H
12 
13 #include "llvm/ADT/Optional.h"
14 #include "llvm/ADT/STLExtras.h"
15 #include "llvm/ADT/SmallVector.h"
16 #include "llvm/ADT/StringRef.h"
27 #include <algorithm>
28 #include <cassert>
29 #include <cstddef>
30 #include <cstdint>
31 #include <map>
32 #include <memory>
33 #include <utility>
34 #include <vector>
35 
36 namespace llvm {
37 
38 class DWARFAbbreviationDeclarationSet;
39 class DWARFContext;
40 class DWARFDebugAbbrev;
41 class DWARFUnit;
42 
43 /// Base class for all DWARFUnitSection classes. This provides the
44 /// functionality common to all unit types.
46 public:
47  /// Returns the Unit that contains the given section offset in the
48  /// same section this Unit originated from.
49  virtual DWARFUnit *getUnitForOffset(uint32_t Offset) const = 0;
51 
52  void parse(DWARFContext &C, const DWARFSection &Section);
53  void parseDWO(DWARFContext &C, const DWARFSection &DWOSection,
54  bool Lazy = false);
55 
56 protected:
57  ~DWARFUnitSectionBase() = default;
58 
59  virtual void parseImpl(DWARFContext &Context, const DWARFSection &Section,
60  const DWARFDebugAbbrev *DA, const DWARFSection *RS,
61  StringRef SS, const DWARFSection &SOS,
62  const DWARFSection *AOS, const DWARFSection &LS,
63  bool isLittleEndian, bool isDWO, bool Lazy) = 0;
64 };
65 
68 
69 /// Concrete instance of DWARFUnitSection, specialized for one Unit type.
70 template<typename UnitType>
71 class DWARFUnitSection final : public SmallVector<std::unique_ptr<UnitType>, 1>,
72  public DWARFUnitSectionBase {
73  bool Parsed = false;
74  std::function<std::unique_ptr<UnitType>(uint32_t)> Parser;
75 
76 public:
78  using iterator = typename UnitVector::iterator;
80 
82  auto *CU = std::upper_bound(
83  this->begin(), this->end(), Offset,
84  [](uint32_t LHS, const std::unique_ptr<UnitType> &RHS) {
85  return LHS < RHS->getNextUnitOffset();
86  });
87  if (CU != this->end() && (*CU)->getOffset() <= Offset)
88  return CU->get();
89  return nullptr;
90  }
92  const auto *CUOff = E.getOffset(DW_SECT_INFO);
93  if (!CUOff)
94  return nullptr;
95 
96  auto Offset = CUOff->Offset;
97 
98  auto *CU = std::upper_bound(
99  this->begin(), this->end(), CUOff->Offset,
100  [](uint32_t LHS, const std::unique_ptr<UnitType> &RHS) {
101  return LHS < RHS->getNextUnitOffset();
102  });
103  if (CU != this->end() && (*CU)->getOffset() <= Offset)
104  return CU->get();
105 
106  if (!Parser)
107  return nullptr;
108 
109  auto U = Parser(Offset);
110  if (!U)
111  U = nullptr;
112 
113  auto *NewCU = U.get();
114  this->insert(CU, std::move(U));
115  return NewCU;
116  }
117 
118 private:
119  void parseImpl(DWARFContext &Context, const DWARFSection &Section,
120  const DWARFDebugAbbrev *DA, const DWARFSection *RS,
121  StringRef SS, const DWARFSection &SOS, const DWARFSection *AOS,
122  const DWARFSection &LS, bool LE, bool IsDWO,
123  bool Lazy) override {
124  if (Parsed)
125  return;
126  DataExtractor Data(Section.Data, LE, 0);
127  if (!Parser) {
128  const DWARFUnitIndex *Index = nullptr;
129  if (IsDWO)
130  Index = &getDWARFUnitIndex(Context, UnitType::Section);
131  Parser = [=, &Context, &Section, &SOS,
132  &LS](uint32_t Offset) -> std::unique_ptr<UnitType> {
133  if (!Data.isValidOffset(Offset))
134  return nullptr;
135  auto U = llvm::make_unique<UnitType>(
136  Context, Section, DA, RS, SS, SOS, AOS, LS, LE, IsDWO, *this,
137  Index ? Index->getFromOffset(Offset) : nullptr);
138  if (!U->extract(Data, &Offset))
139  return nullptr;
140  return U;
141  };
142  }
143  if (Lazy)
144  return;
145  auto I = this->begin();
146  uint32_t Offset = 0;
147  while (Data.isValidOffset(Offset)) {
148  if (I != this->end() && (*I)->getOffset() == Offset) {
149  ++I;
150  continue;
151  }
152  auto U = Parser(Offset);
153  if (!U)
154  break;
155  Offset = U->getNextUnitOffset();
156  I = std::next(this->insert(I, std::move(U)));
157  }
158  Parsed = true;
159  }
160 };
161 
162 /// Represents base address of the CU.
163 struct BaseAddress {
164  uint64_t Address;
165  uint64_t SectionIndex;
166 };
167 
168 /// Represents a unit's contribution to the string offsets table.
170  uint64_t Base = 0;
171  uint64_t Size = 0;
172  /// Format and version.
174 
175  StrOffsetsContributionDescriptor(uint64_t Base, uint64_t Size,
177  : Base(Base), Size(Size), FormParams({Version, 0, Format}) {}
178 
179  uint8_t getVersion() const { return FormParams.Version; }
180  dwarf::DwarfFormat getFormat() const { return FormParams.Format; }
181  uint8_t getDwarfOffsetByteSize() const {
182  return FormParams.getDwarfOffsetByteSize();
183  }
184  /// Determine whether a contribution to the string offsets table is
185  /// consistent with the relevant section size and that its length is
186  /// a multiple of the size of one of its entries.
188  validateContributionSize(DWARFDataExtractor &DA);
189 };
190 
191 class DWARFUnit {
193  /// Section containing this DWARFUnit.
194  const DWARFSection &InfoSection;
195 
196  const DWARFDebugAbbrev *Abbrev;
197  const DWARFSection *RangeSection;
198  uint32_t RangeSectionBase;
199  const DWARFSection &LineSection;
200  StringRef StringSection;
201  const DWARFSection &StringOffsetSection;
202  const DWARFSection *AddrOffsetSection;
203  uint32_t AddrOffsetSectionBase = 0;
204  bool isLittleEndian;
205  bool isDWO;
206  const DWARFUnitSectionBase &UnitSection;
207 
208  // Version, address size, and DWARF format.
209  DWARFFormParams FormParams;
210  /// Start, length, and DWARF format of the unit's contribution to the string
211  /// offsets table (DWARF v5).
212  Optional<StrOffsetsContributionDescriptor> StringOffsetsTableContribution;
213 
215  uint32_t Length;
216  mutable const DWARFAbbreviationDeclarationSet *Abbrevs;
217  uint64_t AbbrOffset;
218  uint8_t UnitType;
220  /// The compile unit debug information entry items.
221  std::vector<DWARFDebugInfoEntry> DieArray;
222 
223  /// The vector of inlined subroutine DIEs that we can map directly to from
224  /// their subprogram below.
225  std::vector<DWARFDie> InlinedSubroutineDIEs;
226 
227  /// A type representing a subprogram DIE and a map (built using a sorted
228  /// vector) into that subprogram's inlined subroutine DIEs.
229  struct SubprogramDIEAddrInfo {
230  DWARFDie SubprogramDIE;
231 
232  uint64_t SubprogramBasePC;
233 
234  /// A vector sorted to allow mapping from a relative PC to the inlined
235  /// subroutine DIE with the most specific address range covering that PC.
236  ///
237  /// The PCs are relative to the `SubprogramBasePC`.
238  ///
239  /// The vector is sorted in ascending order of the first int which
240  /// represents the relative PC for an interval in the map. The second int
241  /// represents the index into the `InlinedSubroutineDIEs` vector of the DIE
242  /// that interval maps to. An index of '-1` indicates an empty mapping. The
243  /// interval covered is from the `.first` relative PC to the next entry's
244  /// `.first` relative PC.
245  std::vector<std::pair<uint32_t, int32_t>> InlinedSubroutineDIEAddrMap;
246  };
247 
248  /// Vector of the subprogram DIEs and their subroutine address maps.
249  std::vector<SubprogramDIEAddrInfo> SubprogramDIEAddrInfos;
250 
251  /// A vector sorted to allow mapping from a PC to the subprogram DIE (and
252  /// associated addr map) index. Subprograms with overlapping PC ranges aren't
253  /// supported here. Nothing will crash, but the mapping may be inaccurate.
254  /// This vector may also contain "empty" ranges marked by an address with
255  /// a DIE index of '-1'.
256  std::vector<std::pair<uint64_t, int64_t>> SubprogramDIEAddrMap;
257 
258  using die_iterator_range =
260 
261  std::shared_ptr<DWARFUnit> DWO;
262 
263  const DWARFUnitIndex::Entry *IndexEntry;
264 
265  uint32_t getDIEIndex(const DWARFDebugInfoEntry *Die) {
266  auto First = DieArray.data();
267  assert(Die >= First && Die < First + DieArray.size());
268  return Die - First;
269  }
270 
271 protected:
272  virtual bool extractImpl(DataExtractor debug_info, uint32_t *offset_ptr);
273 
274  /// Size in bytes of the unit header.
275  virtual uint32_t getHeaderSize() const { return getVersion() <= 4 ? 11 : 12; }
276 
277  /// Find the unit's contribution to the string offsets table and determine its
278  /// length and form. The given offset is expected to be derived from the unit
279  /// DIE's DW_AT_str_offsets_base attribute.
281  determineStringOffsetsTableContribution(DWARFDataExtractor &DA,
282  uint64_t Offset);
283 
284  /// Find the unit's contribution to the string offsets table and determine its
285  /// length and form. The given offset is expected to be 0 in a dwo file or,
286  /// in a dwp file, the start of the unit's contribution to the string offsets
287  /// table section (as determined by the index table).
289  determineStringOffsetsTableContributionDWO(DWARFDataExtractor &DA,
290  uint64_t Offset);
291 
292 public:
293  DWARFUnit(DWARFContext &Context, const DWARFSection &Section,
294  const DWARFDebugAbbrev *DA, const DWARFSection *RS, StringRef SS,
295  const DWARFSection &SOS, const DWARFSection *AOS,
296  const DWARFSection &LS, bool LE, bool IsDWO,
297  const DWARFUnitSectionBase &UnitSection,
298  const DWARFUnitIndex::Entry *IndexEntry = nullptr);
299 
300  virtual ~DWARFUnit();
301 
302  DWARFContext& getContext() const { return Context; }
303 
304  const DWARFSection &getLineSection() const { return LineSection; }
305  StringRef getStringSection() const { return StringSection; }
307  return StringOffsetSection;
308  }
309 
311  AddrOffsetSection = AOS;
312  AddrOffsetSectionBase = Base;
313  }
314 
316  RangeSection = RS;
317  RangeSectionBase = Base;
318  }
319 
320  bool getAddrOffsetSectionItem(uint32_t Index, uint64_t &Result) const;
321  bool getStringOffsetSectionItem(uint32_t Index, uint64_t &Result) const;
322 
323  DWARFDataExtractor getDebugInfoExtractor() const;
324 
326  return DataExtractor(StringSection, false, 0);
327  }
328 
329 
330  bool extract(DataExtractor debug_info, uint32_t* offset_ptr);
331 
332  /// extractRangeList - extracts the range list referenced by this compile
333  /// unit from .debug_ranges section. Returns true on success.
334  /// Requires that compile unit is already extracted.
335  bool extractRangeList(uint32_t RangeListOffset,
336  DWARFDebugRangeList &RangeList) const;
337  void clear();
338  uint32_t getOffset() const { return Offset; }
339  uint32_t getNextUnitOffset() const { return Offset + Length + 4; }
340  uint32_t getLength() const { return Length; }
341 
344  return StringOffsetsTableContribution;
345  }
346  const DWARFFormParams &getFormParams() const { return FormParams; }
347  uint16_t getVersion() const { return FormParams.Version; }
348  dwarf::DwarfFormat getFormat() const { return FormParams.Format; }
349  uint8_t getAddressByteSize() const { return FormParams.AddrSize; }
350  uint8_t getRefAddrByteSize() const { return FormParams.getRefAddrByteSize(); }
351  uint8_t getDwarfOffsetByteSize() const {
352  return FormParams.getDwarfOffsetByteSize();
353  }
354 
356  assert(StringOffsetsTableContribution);
357  return StringOffsetsTableContribution->getDwarfOffsetByteSize();
358  }
359 
360  uint64_t getStringOffsetsBase() const {
361  assert(StringOffsetsTableContribution);
362  return StringOffsetsTableContribution->Base;
363  }
364 
365  const DWARFAbbreviationDeclarationSet *getAbbreviations() const;
366 
367  uint8_t getUnitType() const { return UnitType; }
368 
369  static bool isMatchingUnitTypeAndTag(uint8_t UnitType, dwarf::Tag Tag) {
370  switch (UnitType) {
371  case dwarf::DW_UT_compile:
372  return Tag == dwarf::DW_TAG_compile_unit;
373  case dwarf::DW_UT_type:
374  return Tag == dwarf::DW_TAG_type_unit;
375  case dwarf::DW_UT_partial:
376  return Tag == dwarf::DW_TAG_partial_unit;
377  case dwarf::DW_UT_skeleton:
378  return Tag == dwarf::DW_TAG_skeleton_unit;
379  case dwarf::DW_UT_split_compile:
380  case dwarf::DW_UT_split_type:
381  return dwarf::isUnitType(Tag);
382  }
383  return false;
384  }
385 
386  /// \brief Return the number of bytes for the header of a unit of
387  /// UnitType type.
388  ///
389  /// This function must be called with a valid unit type which in
390  /// DWARF5 is defined as one of the following six types.
391  static uint32_t getDWARF5HeaderSize(uint8_t UnitType) {
392  switch (UnitType) {
393  case dwarf::DW_UT_compile:
394  case dwarf::DW_UT_partial:
395  return 12;
396  case dwarf::DW_UT_skeleton:
397  case dwarf::DW_UT_split_compile:
398  return 20;
399  case dwarf::DW_UT_type:
400  case dwarf::DW_UT_split_type:
401  return 24;
402  }
403  llvm_unreachable("Invalid UnitType.");
404  }
405 
406  llvm::Optional<BaseAddress> getBaseAddress() const { return BaseAddr; }
407 
408  void setBaseAddress(BaseAddress BaseAddr) { this->BaseAddr = BaseAddr; }
409 
410  DWARFDie getUnitDIE(bool ExtractUnitDIEOnly = true) {
411  extractDIEsIfNeeded(ExtractUnitDIEOnly);
412  if (DieArray.empty())
413  return DWARFDie();
414  return DWARFDie(this, &DieArray[0]);
415  }
416 
417  const char *getCompilationDir();
418  Optional<uint64_t> getDWOId();
419 
420  void collectAddressRanges(DWARFAddressRangesVector &CURanges);
421 
422  /// Returns subprogram DIE with address range encompassing the provided
423  /// address. The pointer is alive as long as parsed compile unit DIEs are not
424  /// cleared.
425  DWARFDie getSubroutineForAddress(uint64_t Address);
426 
427  /// getInlinedChainForAddress - fetches inlined chain for a given address.
428  /// Returns empty chain if there is no subprogram containing address. The
429  /// chain is valid as long as parsed compile unit DIEs are not cleared.
430  void getInlinedChainForAddress(uint64_t Address,
431  SmallVectorImpl<DWARFDie> &InlinedChain);
432 
433  /// getUnitSection - Return the DWARFUnitSection containing this unit.
434  const DWARFUnitSectionBase &getUnitSection() const { return UnitSection; }
435 
436  /// \brief Returns the number of DIEs in the unit. Parses the unit
437  /// if necessary.
438  unsigned getNumDIEs() {
439  extractDIEsIfNeeded(false);
440  return DieArray.size();
441  }
442 
443  /// \brief Return the index of a DIE inside the unit's DIE vector.
444  ///
445  /// It is illegal to call this method with a DIE that hasn't be
446  /// created by this unit. In other word, it's illegal to call this
447  /// method on a DIE that isn't accessible by following
448  /// children/sibling links starting from this unit's getUnitDIE().
450  return getDIEIndex(D.getDebugInfoEntry());
451  }
452 
453  /// \brief Return the DIE object at the given index.
454  DWARFDie getDIEAtIndex(unsigned Index) {
455  assert(Index < DieArray.size());
456  return DWARFDie(this, &DieArray[Index]);
457  }
458 
460  DWARFDie getSibling(const DWARFDebugInfoEntry *Die);
461  DWARFDie getFirstChild(const DWARFDebugInfoEntry *Die);
462 
463  /// \brief Return the DIE object for a given offset inside the
464  /// unit's DIE vector.
465  ///
466  /// The unit needs to have its DIEs extracted for this method to work.
468  extractDIEsIfNeeded(false);
469  assert(!DieArray.empty());
470  auto it = std::lower_bound(
471  DieArray.begin(), DieArray.end(), Offset,
472  [](const DWARFDebugInfoEntry &LHS, uint32_t Offset) {
473  return LHS.getOffset() < Offset;
474  });
475  if (it != DieArray.end() && it->getOffset() == Offset)
476  return DWARFDie(this, &*it);
477  return DWARFDie();
478  }
479 
481  if (IndexEntry)
482  if (const auto *Contrib = IndexEntry->getOffset(DW_SECT_LINE))
483  return Contrib->Offset;
484  return 0;
485  }
486 
488  extractDIEsIfNeeded(false);
489  return die_iterator_range(DieArray.begin(), DieArray.end());
490  }
491 
492 private:
493  /// Size in bytes of the .debug_info data associated with this compile unit.
494  size_t getDebugInfoSize() const { return Length + 4 - getHeaderSize(); }
495 
496  /// extractDIEsIfNeeded - Parses a compile unit and indexes its DIEs if it
497  /// hasn't already been done. Returns the number of DIEs parsed at this call.
498  size_t extractDIEsIfNeeded(bool CUDieOnly);
499 
500  /// extractDIEsToVector - Appends all parsed DIEs to a vector.
501  void extractDIEsToVector(bool AppendCUDie, bool AppendNonCUDIEs,
502  std::vector<DWARFDebugInfoEntry> &DIEs) const;
503 
504  /// clearDIEs - Clear parsed DIEs to keep memory usage low.
505  void clearDIEs(bool KeepCUDie);
506 
507  /// parseDWO - Parses .dwo file for current compile unit. Returns true if
508  /// it was actually constructed.
509  bool parseDWO();
510 
511  void buildSubprogramDIEAddrMap();
512  void buildInlinedSubroutineDIEAddrMap(SubprogramDIEAddrInfo &SPInfo);
513 };
514 
515 } // end namespace llvm
516 
517 #endif // LLVM_DEBUGINFO_DWARF_DWARFUNIT_H
static bool isMatchingUnitTypeAndTag(uint8_t UnitType, dwarf::Tag Tag)
Definition: DWARFUnit.h:369
uint64_t CallInst * C
const_iterator end(StringRef path)
Get end iterator over path.
Definition: Path.cpp:245
LLVMContext & Context
const_iterator begin(StringRef path, Style style=Style::native)
Get begin iterator over path.
Definition: Path.cpp:236
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
Represents a unit&#39;s contribution to the string offsets table.
Definition: DWARFUnit.h:169
virtual void parseImpl(DWARFContext &Context, const DWARFSection &Section, const DWARFDebugAbbrev *DA, const DWARFSection *RS, StringRef SS, const DWARFSection &SOS, const DWARFSection *AOS, const DWARFSection &LS, bool isLittleEndian, bool isDWO, bool Lazy)=0
bool isUnitType(uint8_t UnitType)
Definition: Dwarf.h:328
This provides a very simple, boring adaptor for a begin and end iterator into a range type...
dwarf::DwarfFormat getFormat() const
Definition: DWARFUnit.h:348
const DWARFFormParams & getFormParams() const
Definition: DWARFUnit.h:346
void parseDWO(DWARFContext &C, const DWARFSection &DWOSection, bool Lazy=false)
Definition: DWARFUnit.cpp:41
void setAddrOffsetSection(const DWARFSection *AOS, uint32_t Base)
Definition: DWARFUnit.h:310
void setBaseAddress(BaseAddress BaseAddr)
Definition: DWARFUnit.h:408
const Optional< StrOffsetsContributionDescriptor > & getStringOffsetsTableContribution() const
Definition: DWARFUnit.h:343
uint8_t getRefAddrByteSize() const
Definition: DWARFUnit.h:350
dwarf::DwarfFormat getFormat() const
Definition: DWARFUnit.h:180
uint8_t getDwarfStringOffsetsByteSize() const
Definition: DWARFUnit.h:355
UnitType * getUnitForIndexEntry(const DWARFUnitIndex::Entry &E) override
Definition: DWARFUnit.h:91
dwarf::DwarfFormat Format
uint32_t getNextUnitOffset() const
Definition: DWARFUnit.h:339
DwarfFormat
Constants that define the DWARF format as 32 or 64 bit.
Definition: Dwarf.h:518
const DWARFSection & getLineSection() const
Definition: DWARFUnit.h:304
virtual uint32_t getHeaderSize() const
Size in bytes of the unit header.
Definition: DWARFUnit.h:275
const DWARFDebugInfoEntry * getDebugInfoEntry() const
Definition: DWARFDie.h:53
uint8_t getAddressByteSize() const
Definition: DWARFUnit.h:349
UnitType * getUnitForOffset(uint32_t Offset) const override
Returns the Unit that contains the given section offset in the same section this Unit originated from...
Definition: DWARFUnit.h:81
uint8_t getRefAddrByteSize() const
The definition of the size of form DW_FORM_ref_addr depends on the version.
unsigned getNumDIEs()
Returns the number of DIEs in the unit.
Definition: DWARFUnit.h:438
uint64_t Address
Definition: DWARFUnit.h:164
void parse(DWARFContext &C, const DWARFSection &Section)
Definition: DWARFUnit.cpp:33
auto lower_bound(R &&Range, ForwardIt I) -> decltype(adl_begin(Range))
Provide wrappers to std::lower_bound which take ranges instead of having to pass begin/end explicitly...
Definition: STLExtras.h:910
const DWARFSection & getStringOffsetSection() const
Definition: DWARFUnit.h:306
uint16_t getVersion() const
Definition: DWARFUnit.h:347
virtual DWARFUnit * getUnitForOffset(uint32_t Offset) const =0
Returns the Unit that contains the given section offset in the same section this Unit originated from...
die_iterator_range dies()
Definition: DWARFUnit.h:487
Utility class that carries the DWARF compile/type unit and the debug info entry in an object...
Definition: DWARFDie.h:43
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
DWARFSectionKind
static uint32_t getDWARF5HeaderSize(uint8_t UnitType)
Return the number of bytes for the header of a unit of UnitType type.
Definition: DWARFUnit.h:391
StringRef getStringSection() const
Definition: DWARFUnit.h:305
uint32_t getDIEIndex(const DWARFDie &D)
Return the index of a DIE inside the unit&#39;s DIE vector.
Definition: DWARFUnit.h:449
DWARFContext & getContext() const
Definition: DWARFUnit.h:302
void setRangesSection(const DWARFSection *RS, uint32_t Base)
Definition: DWARFUnit.h:315
const DWARFUnitIndex & getDWARFUnitIndex(DWARFContext &Context, DWARFSectionKind Kind)
Definition: DWARFUnit.cpp:755
StrOffsetsContributionDescriptor(uint64_t Base, uint64_t Size, uint8_t Version, dwarf::DwarfFormat Format)
Definition: DWARFUnit.h:175
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
uint64_t SectionIndex
Definition: DWARFUnit.h:165
UnitType
Constants for unit types in DWARF v5.
Definition: Dwarf.h:321
llvm::Optional< BaseAddress > getBaseAddress() const
Definition: DWARFUnit.h:406
A DataExtractor (typically for an in-memory copy of an object-file section) plus a relocation map for...
uint64_t getStringOffsetsBase() const
Definition: DWARFUnit.h:360
DWARFDie getUnitDIE(bool ExtractUnitDIEOnly=true)
Definition: DWARFUnit.h:410
Represents base address of the CU.
Definition: DWARFUnit.h:163
This is a &#39;vector&#39; (really, a variable-sized array), optimized for the case when the array is small...
Definition: SmallVector.h:862
Concrete instance of DWARFUnitSection, specialized for one Unit type.
Definition: DWARFUnit.h:71
DWARFContext This data structure is the top level entity that deals with dwarf debug information pars...
Definition: DWARFContext.h:59
A helper struct for DWARFFormValue methods, providing information that allows it to know the byte siz...
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
A range adaptor for a pair of iterators.
This file contains constants used for implementing Dwarf debug support.
uint32_t getLength() const
Definition: DWARFUnit.h:340
loop extract
static void clear(coro::Shape &Shape)
Definition: Coroutines.cpp:210
DataExtractor getStringExtractor() const
Definition: DWARFUnit.h:325
DWARFDie getDIEAtIndex(unsigned Index)
Return the DIE object at the given index.
Definition: DWARFUnit.h:454
#define I(x, y, z)
Definition: MD5.cpp:58
const DWARFUnitSectionBase & getUnitSection() const
getUnitSection - Return the DWARFUnitSection containing this unit.
Definition: DWARFUnit.h:434
uint32_t getOffset() const
Definition: DWARFUnit.h:338
bool isValidOffset(uint32_t offset) const
Test the validity of offset.
const unsigned Kind
uint8_t getUnitType() const
Definition: DWARFUnit.h:367
DWARFDie getDIEForOffset(uint32_t Offset)
Return the DIE object for a given offset inside the unit&#39;s DIE vector.
Definition: DWARFUnit.h:467
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Base class for all DWARFUnitSection classes.
Definition: DWARFUnit.h:45
uint8_t getDwarfOffsetByteSize() const
The size of a reference is determined by the DWARF 32/64-bit format.
std::vector< DWARFAddressRange > DWARFAddressRangesVector
DWARFAddressRangesVector - represents a set of absolute address ranges.
DWARFDebugInfoEntry - A DIE with only the minimum required data.
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
static const Function * getParent(const Value *V)
const Entry * getFromOffset(uint32_t Offset) const
const SectionContribution * getOffset(DWARFSectionKind Sec) const
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
const uint64_t Version
Definition: InstrProf.h:867
uint8_t getDwarfOffsetByteSize() const
Definition: DWARFUnit.h:351
uint32_t getLineTableOffset() const
Definition: DWARFUnit.h:480
virtual DWARFUnit * getUnitForIndexEntry(const DWARFUnitIndex::Entry &E)=0