LLVM  14.0.0git
DWARFContext.h
Go to the documentation of this file.
1 //===- DWARFContext.h -------------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===/
8 
9 #ifndef LLVM_DEBUGINFO_DWARF_DWARFCONTEXT_H
10 #define LLVM_DEBUGINFO_DWARF_DWARFCONTEXT_H
11 
12 #include "llvm/ADT/MapVector.h"
13 #include "llvm/ADT/SmallString.h"
14 #include "llvm/ADT/SmallVector.h"
15 #include "llvm/ADT/StringMap.h"
16 #include "llvm/ADT/StringRef.h"
34 #include "llvm/Object/Binary.h"
35 #include "llvm/Object/ObjectFile.h"
37 #include "llvm/Support/Error.h"
38 #include "llvm/Support/Host.h"
39 #include <cstdint>
40 #include <deque>
41 #include <map>
42 #include <memory>
43 
44 namespace llvm {
45 
46 class MCRegisterInfo;
47 class MemoryBuffer;
48 class raw_ostream;
49 
50 /// DWARFContext
51 /// This data structure is the top level entity that deals with dwarf debug
52 /// information parsing. The actual data is supplied through DWARFObj.
53 class DWARFContext : public DIContext {
54  DWARFUnitVector NormalUnits;
56  std::unique_ptr<DWARFUnitIndex> CUIndex;
57  std::unique_ptr<DWARFGdbIndex> GdbIndex;
58  std::unique_ptr<DWARFUnitIndex> TUIndex;
59  std::unique_ptr<DWARFDebugAbbrev> Abbrev;
60  std::unique_ptr<DWARFDebugLoc> Loc;
61  std::unique_ptr<DWARFDebugAranges> Aranges;
62  std::unique_ptr<DWARFDebugLine> Line;
63  std::unique_ptr<DWARFDebugFrame> DebugFrame;
64  std::unique_ptr<DWARFDebugFrame> EHFrame;
65  std::unique_ptr<DWARFDebugMacro> Macro;
66  std::unique_ptr<DWARFDebugMacro> Macinfo;
67  std::unique_ptr<DWARFDebugNames> Names;
68  std::unique_ptr<AppleAcceleratorTable> AppleNames;
69  std::unique_ptr<AppleAcceleratorTable> AppleTypes;
70  std::unique_ptr<AppleAcceleratorTable> AppleNamespaces;
71  std::unique_ptr<AppleAcceleratorTable> AppleObjC;
72 
73  DWARFUnitVector DWOUnits;
75  std::unique_ptr<DWARFDebugAbbrev> AbbrevDWO;
76  std::unique_ptr<DWARFDebugMacro> MacinfoDWO;
77  std::unique_ptr<DWARFDebugMacro> MacroDWO;
78 
79  /// The maximum DWARF version of all units.
80  unsigned MaxVersion = 0;
81 
82  struct DWOFile {
84  std::unique_ptr<DWARFContext> Context;
85  };
87  std::weak_ptr<DWOFile> DWP;
88  bool CheckedForDWP = false;
89  std::string DWPName;
90 
91  std::unique_ptr<MCRegisterInfo> RegInfo;
92 
93  std::function<void(Error)> RecoverableErrorHandler =
96 
97  /// Read compile units from the debug_info section (if necessary)
98  /// and type units from the debug_types sections (if necessary)
99  /// and store them in NormalUnits.
100  void parseNormalUnits();
101 
102  /// Read compile units from the debug_info.dwo section (if necessary)
103  /// and type units from the debug_types.dwo section (if necessary)
104  /// and store them in DWOUnits.
105  /// If \p Lazy is true, set up to parse but don't actually parse them.
106  enum { EagerParse = false, LazyParse = true };
107  void parseDWOUnits(bool Lazy = false);
108 
109  std::unique_ptr<const DWARFObject> DObj;
110 
111  /// Helper enum to distinguish between macro[.dwo] and macinfo[.dwo]
112  /// section.
113  enum MacroSecType {
114  MacinfoSection,
115  MacinfoDwoSection,
116  MacroSection,
117  MacroDwoSection
118  };
119 
120 public:
121  DWARFContext(std::unique_ptr<const DWARFObject> DObj,
122  std::string DWPName = "",
123  std::function<void(Error)> RecoverableErrorHandler =
125  std::function<void(Error)> WarningHandler =
127  ~DWARFContext();
128 
129  DWARFContext(DWARFContext &) = delete;
130  DWARFContext &operator=(DWARFContext &) = delete;
131 
132  const DWARFObject &getDWARFObj() const { return *DObj; }
133 
134  static bool classof(const DIContext *DICtx) {
135  return DICtx->getKind() == CK_DWARF;
136  }
137 
138  /// Dump a textual representation to \p OS. If any \p DumpOffsets are present,
139  /// dump only the record at the specified offset.
140  void dump(raw_ostream &OS, DIDumpOptions DumpOpts,
141  std::array<Optional<uint64_t>, DIDT_ID_Count> DumpOffsets);
142 
143  void dump(raw_ostream &OS, DIDumpOptions DumpOpts) override {
144  std::array<Optional<uint64_t>, DIDT_ID_Count> DumpOffsets;
145  dump(OS, DumpOpts, DumpOffsets);
146  }
147 
148  bool verify(raw_ostream &OS, DIDumpOptions DumpOpts = {}) override;
149 
152 
153  /// Get units from .debug_info in this context.
155  parseNormalUnits();
156  return unit_iterator_range(NormalUnits.begin(),
157  NormalUnits.begin() +
158  NormalUnits.getNumInfoUnits());
159  }
160 
162  parseNormalUnits();
163  return NormalUnits;
164  }
165 
166  /// Get units from .debug_types in this context.
168  parseNormalUnits();
169  return unit_iterator_range(
170  NormalUnits.begin() + NormalUnits.getNumInfoUnits(), NormalUnits.end());
171  }
172 
173  /// Get compile units in this context.
176  }
177 
178  // If you want type_units(), it'll need to be a concat iterator of a filter of
179  // TUs in info_section + all the (all type) units in types_section
180 
181  /// Get all normal compile/type units in this context.
183  parseNormalUnits();
184  return unit_iterator_range(NormalUnits.begin(), NormalUnits.end());
185  }
186 
187  /// Get units from .debug_info..dwo in the DWO context.
189  parseDWOUnits();
190  return unit_iterator_range(DWOUnits.begin(),
191  DWOUnits.begin() + DWOUnits.getNumInfoUnits());
192  }
193 
195  parseDWOUnits();
196  return DWOUnits;
197  }
198 
199  /// Get units from .debug_types.dwo in the DWO context.
201  parseDWOUnits();
202  return unit_iterator_range(DWOUnits.begin() + DWOUnits.getNumInfoUnits(),
203  DWOUnits.end());
204  }
205 
206  /// Get compile units in the DWO context.
209  }
210 
211  // If you want dwo_type_units(), it'll need to be a concat iterator of a
212  // filter of TUs in dwo_info_section + all the (all type) units in
213  // dwo_types_section.
214 
215  /// Get all units in the DWO context.
217  parseDWOUnits();
218  return unit_iterator_range(DWOUnits.begin(), DWOUnits.end());
219  }
220 
221  /// Get the number of compile units in this context.
222  unsigned getNumCompileUnits() {
223  parseNormalUnits();
224  return NormalUnits.getNumInfoUnits();
225  }
226 
227  /// Get the number of type units in this context.
228  unsigned getNumTypeUnits() {
229  parseNormalUnits();
230  return NormalUnits.getNumTypesUnits();
231  }
232 
233  /// Get the number of compile units in the DWO context.
235  parseDWOUnits();
236  return DWOUnits.getNumInfoUnits();
237  }
238 
239  /// Get the number of type units in the DWO context.
240  unsigned getNumDWOTypeUnits() {
241  parseDWOUnits();
242  return DWOUnits.getNumTypesUnits();
243  }
244 
245  /// Get the unit at the specified index.
247  parseNormalUnits();
248  return NormalUnits[index].get();
249  }
250 
251  /// Get the unit at the specified index for the DWO units.
253  parseDWOUnits();
254  return DWOUnits[index].get();
255  }
256 
259 
260  /// Return the compile unit that includes an offset (relative to .debug_info).
262 
263  /// Get a DIE given an exact offset.
265 
266  unsigned getMaxVersion() {
267  // Ensure info units have been parsed to discover MaxVersion
269  return MaxVersion;
270  }
271 
272  unsigned getMaxDWOVersion() {
273  // Ensure DWO info units have been parsed to discover MaxVersion
275  return MaxVersion;
276  }
277 
279  if (Version > MaxVersion)
280  MaxVersion = Version;
281  }
282 
283  const DWARFUnitIndex &getCUIndex();
285  const DWARFUnitIndex &getTUIndex();
286 
287  /// Get a pointer to the parsed DebugAbbrev object.
289 
290  /// Get a pointer to the parsed DebugLoc object.
291  const DWARFDebugLoc *getDebugLoc();
292 
293  /// Get a pointer to the parsed dwo abbreviations object.
295 
296  /// Get a pointer to the parsed DebugAranges object.
298 
299  /// Get a pointer to the parsed frame information object.
301 
302  /// Get a pointer to the parsed eh frame information object.
304 
305  /// Get a pointer to the parsed DebugMacinfo information object.
307 
308  /// Get a pointer to the parsed DebugMacinfoDWO information object.
310 
311  /// Get a pointer to the parsed DebugMacro information object.
313 
314  /// Get a pointer to the parsed DebugMacroDWO information object.
316 
317  /// Get a reference to the parsed accelerator table object.
319 
320  /// Get a reference to the parsed accelerator table object.
322 
323  /// Get a reference to the parsed accelerator table object.
325 
326  /// Get a reference to the parsed accelerator table object.
328 
329  /// Get a reference to the parsed accelerator table object.
331 
332  /// Get a pointer to a parsed line table corresponding to a compile unit.
333  /// Report any parsing issues as warnings on stderr.
335 
336  /// Get a pointer to a parsed line table corresponding to a compile unit.
337  /// Report any recoverable parsing problems using the handler.
340  function_ref<void(Error)> RecoverableErrorHandler);
341 
343  return DataExtractor(DObj->getStrSection(), false, 0);
344  }
346  return DataExtractor(DObj->getStrDWOSection(), false, 0);
347  }
349  return DataExtractor(DObj->getLineStrSection(), false, 0);
350  }
351 
352  /// Wraps the returned DIEs for a given address.
353  struct DIEsForAddress {
357  explicit operator bool() const { return CompileUnit != nullptr; }
358  };
359 
360  /// Get the compilation unit, the function DIE and lexical block DIE for the
361  /// given address where applicable.
362  /// TODO: change input parameter from "uint64_t Address"
363  /// into "SectionedAddress Address"
364  DIEsForAddress getDIEsForAddress(uint64_t Address);
365 
367  object::SectionedAddress Address,
368  DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
371  DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
373  object::SectionedAddress Address,
374  DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
375 
376  std::vector<DILocal>
378 
379  bool isLittleEndian() const { return DObj->isLittleEndian(); }
380  static unsigned getMaxSupportedVersion() { return 5; }
381  static bool isSupportedVersion(unsigned version) {
382  return version >= 2 && version <= getMaxSupportedVersion();
383  }
384 
386  return {2, 4, 8};
387  }
388  static bool isAddressSizeSupported(unsigned AddressSize) {
389  return llvm::is_contained(getSupportedAddressSizes(), AddressSize);
390  }
391  template <typename... Ts>
392  static Error checkAddressSizeSupported(unsigned AddressSize,
393  std::error_code EC, char const *Fmt,
394  const Ts &...Vals) {
395  if (isAddressSizeSupported(AddressSize))
396  return Error::success();
397  std::string Buffer;
398  raw_string_ostream Stream(Buffer);
399  Stream << format(Fmt, Vals...)
400  << " has unsupported address size: " << AddressSize
401  << " (supported are ";
402  ListSeparator LS;
404  Stream << LS << Size;
405  Stream << ')';
406  return make_error<StringError>(Stream.str(), EC);
407  }
408 
409  std::shared_ptr<DWARFContext> getDWOContext(StringRef AbsolutePath);
410 
411  const MCRegisterInfo *getRegisterInfo() const { return RegInfo.get(); }
412 
414  return RecoverableErrorHandler;
415  }
416 
417  function_ref<void(Error)> getWarningHandler() { return WarningHandler; }
418 
420 
421  static std::unique_ptr<DWARFContext>
422  create(const object::ObjectFile &Obj,
424  const LoadedObjectInfo *L = nullptr, std::string DWPName = "",
425  std::function<void(Error)> RecoverableErrorHandler =
427  std::function<void(Error)> WarningHandler =
429 
430  static std::unique_ptr<DWARFContext>
431  create(const StringMap<std::unique_ptr<MemoryBuffer>> &Sections,
432  uint8_t AddrSize, bool isLittleEndian = sys::IsLittleEndianHost,
433  std::function<void(Error)> RecoverableErrorHandler =
435  std::function<void(Error)> WarningHandler =
437 
438  /// Loads register info for the architecture of the provided object file.
439  /// Improves readability of dumped DWARF expressions. Requires the caller to
440  /// have initialized the relevant target descriptions.
442 
443  /// Get address size from CUs.
444  /// TODO: refactor compile_units() to make this const.
445  uint8_t getCUAddrSize();
446 
448  return getDWARFObj().getFile()->getArch();
449  }
450 
451  /// Return the compile unit which contains instruction with provided
452  /// address.
453  /// TODO: change input parameter from "uint64_t Address"
454  /// into "SectionedAddress Address"
456 
457 private:
458  /// Parse a macro[.dwo] or macinfo[.dwo] section.
459  std::unique_ptr<DWARFDebugMacro>
460  parseMacroOrMacinfo(MacroSecType SectionType);
461 
462  void addLocalsForDie(DWARFCompileUnit *CU, DWARFDie Subprogram, DWARFDie Die,
463  std::vector<DILocal> &Result);
464 };
465 
466 } // end namespace llvm
467 
468 #endif // LLVM_DEBUGINFO_DWARF_DWARFCONTEXT_H
llvm::Check::Size
@ Size
Definition: FileCheck.h:73
llvm::DWARFContext::getDebugNames
const DWARFDebugNames & getDebugNames()
Get a reference to the parsed accelerator table object.
Definition: DWARFContext.cpp:930
llvm::DWARFContext::getLineTableForUnit
const DWARFDebugLine::LineTable * getLineTableForUnit(DWARFUnit *U)
Get a pointer to a parsed line table corresponding to a compile unit.
Definition: DWARFContext.cpp:957
llvm::DWARFContext::dump
void dump(raw_ostream &OS, DIDumpOptions DumpOpts) override
Definition: DWARFContext.h:143
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:22
DWARFCompileUnit.h
llvm::DWARFContext::types_section_units
unit_iterator_range types_section_units()
Get units from .debug_types in this context.
Definition: DWARFContext.h:167
llvm::DWARFContext::create
static std::unique_ptr< DWARFContext > create(const object::ObjectFile &Obj, ProcessDebugRelocations RelocAction=ProcessDebugRelocations::Process, const LoadedObjectInfo *L=nullptr, std::string DWPName="", std::function< void(Error)> RecoverableErrorHandler=WithColor::defaultErrorHandler, std::function< void(Error)> WarningHandler=WithColor::defaultWarningHandler)
Definition: DWARFContext.cpp:1998
llvm::DWARFContext::getEHFrame
Expected< const DWARFDebugFrame * > getEHFrame()
Get a pointer to the parsed eh frame information object.
Definition: DWARFContext.cpp:876
llvm::DWARFContext::unit_iterator_range
DWARFUnitVector::iterator_range unit_iterator_range
Definition: DWARFContext.h:150
DWARFGdbIndex.h
DWARFAcceleratorTable.h
llvm::DWARFContext::compile_unit_range
DWARFUnitVector::compile_unit_range compile_unit_range
Definition: DWARFContext.h:151
DWARFDebugMacro.h
llvm::DIInliningInfo
A format-neutral container for inlined code description.
Definition: DIContext.h:87
llvm::DILineInfoSpecifier
Controls which fields of DILineInfo container should be filled with data.
Definition: DIContext.h:135
StringRef.h
llvm::DWARFContext::getAppleNames
const AppleAcceleratorTable & getAppleNames()
Get a reference to the parsed accelerator table object.
Definition: DWARFContext.cpp:935
DWARFObject.h
llvm::raw_string_ostream
A raw_ostream that writes to an std::string.
Definition: raw_ostream.h:632
Host.h
llvm::SmallVector
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition: SmallVector.h:1175
llvm::DWARFContext::getNumTypeUnits
unsigned getNumTypeUnits()
Get the number of type units in this context.
Definition: DWARFContext.h:228
llvm::DWARFContext::getDWOCompileUnitForHash
DWARFCompileUnit * getDWOCompileUnitForHash(uint64_t Hash)
Definition: DWARFContext.cpp:724
llvm::Error::success
static ErrorSuccess success()
Create a success value.
Definition: Error.h:329
MapVector.h
llvm::DWARFContext::getLineInfoForAddressRange
DILineInfoTable getLineInfoForAddressRange(object::SectionedAddress Address, uint64_t Size, DILineInfoSpecifier Specifier=DILineInfoSpecifier()) override
Definition: DWARFContext.cpp:1277
DWARFDebugLine.h
Error.h
llvm::DWARFObject::getFile
virtual const object::ObjectFile * getFile() const
Definition: DWARFObject.h:31
llvm::DWARFContext::getStringExtractor
DataExtractor getStringExtractor() const
Definition: DWARFContext.h:342
llvm::DWARFContext::info_section_units
unit_iterator_range info_section_units()
Get units from .debug_info in this context.
Definition: DWARFContext.h:154
llvm::DWARFContext
DWARFContext This data structure is the top level entity that deals with dwarf debug information pars...
Definition: DWARFContext.h:53
llvm::WithColor::defaultErrorHandler
static void defaultErrorHandler(Error Err)
Implement default handling for Error.
Definition: WithColor.cpp:151
llvm::object::ObjectFile::getArch
virtual Triple::ArchType getArch() const =0
llvm::DWARFContext::getSupportedAddressSizes
static SmallVector< uint8_t, 3 > getSupportedAddressSizes()
Definition: DWARFContext.h:385
llvm::Optional
Definition: APInt.h:33
Offset
uint64_t Offset
Definition: ELFObjHandler.cpp:80
llvm::DWARFContext::getDebugAbbrevDWO
const DWARFDebugAbbrev * getDebugAbbrevDWO()
Get a pointer to the parsed dwo abbreviations object.
Definition: DWARFContext.cpp:817
llvm::DIContext::CK_DWARF
@ CK_DWARF
Definition: DIContext.h:219
llvm::Expected
Tagged union holding either a T or a Error.
Definition: APFloat.h:42
llvm::DWARFContext::dwo_types_section_units
unit_iterator_range dwo_types_section_units()
Get units from .debug_types.dwo in the DWO context.
Definition: DWARFContext.h:200
llvm::DWARFUnitVector::getNumTypesUnits
unsigned getNumTypesUnits() const
Returns number of units from all .debug_types[.dwo] sections.
Definition: DWARFUnit.h:163
llvm::DWARFContext::getLocalsForAddress
std::vector< DILocal > getLocalsForAddress(object::SectionedAddress Address) override
Definition: DWARFContext.cpp:1244
llvm::DWARFContext::getDebugMacroDWO
const DWARFDebugMacro * getDebugMacroDWO()
Get a pointer to the parsed DebugMacroDWO information object.
Definition: DWARFContext.cpp:898
llvm::WithColor::defaultWarningHandler
static void defaultWarningHandler(Error Warning)
Implement default handling for Warning.
Definition: WithColor.cpp:157
llvm::DWARFContext::ProcessDebugRelocations::Process
@ Process
Context
ManagedStatic< detail::RecordContext > Context
Definition: Record.cpp:96
llvm::DWARFContext::getInliningInfoForAddress
DIInliningInfo getInliningInfoForAddress(object::SectionedAddress Address, DILineInfoSpecifier Specifier=DILineInfoSpecifier()) override
Definition: DWARFContext.cpp:1332
llvm::DWARFContext::getAppleObjC
const AppleAcceleratorTable & getAppleObjC()
Get a reference to the parsed accelerator table object.
Definition: DWARFContext.cpp:951
llvm::DWARFContext::getDebugMacinfo
const DWARFDebugMacro * getDebugMacinfo()
Get a pointer to the parsed DebugMacinfo information object.
Definition: DWARFContext.cpp:904
llvm::DWARFContext::getDebugAranges
const DWARFDebugAranges * getDebugAranges()
Get a pointer to the parsed DebugAranges object.
Definition: DWARFContext.cpp:841
llvm::DWARFContext::getDWOUnitsVector
const DWARFUnitVector & getDWOUnitsVector()
Definition: DWARFContext.h:194
llvm::DWARFUnitVector::getNumInfoUnits
unsigned getNumInfoUnits() const
Returns number of units from all .debug_info[.dwo] sections.
Definition: DWARFUnit.h:159
llvm::Triple::ArchType
ArchType
Definition: Triple.h:46
DWARFDebugFrame.h
SmallString.h
llvm::DWARFContext::dwo_info_section_units
unit_iterator_range dwo_info_section_units()
Get units from .debug_info..dwo in the DWO context.
Definition: DWARFContext.h:188
llvm::DWARFContext::getDebugMacinfoDWO
const DWARFDebugMacro * getDebugMacinfoDWO()
Get a pointer to the parsed DebugMacinfoDWO information object.
Definition: DWARFContext.cpp:910
llvm::DWARFDebugAbbrev
Definition: DWARFDebugAbbrev.h:56
llvm::DWARFUnitIndex
Definition: DWARFUnitIndex.h:80
DWARFSection.h
llvm::DWARFContext::getMaxVersion
unsigned getMaxVersion()
Definition: DWARFContext.h:266
llvm::DIContext
Definition: DIContext.h:217
llvm::DWARFContext::getNumCompileUnits
unsigned getNumCompileUnits()
Get the number of compile units in this context.
Definition: DWARFContext.h:222
DWARFDie.h
DWARFDebugLoc.h
llvm::DWARFContext::getArch
Triple::ArchType getArch() const
Definition: DWARFContext.h:447
llvm::DWARFContext::checkAddressSizeSupported
static Error checkAddressSizeSupported(unsigned AddressSize, std::error_code EC, char const *Fmt, const Ts &...Vals)
Definition: DWARFContext.h:392
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:54
llvm::DWARFObject
Definition: DWARFObject.h:25
StringMap.h
llvm::DWARFContext::getStringDWOExtractor
DataExtractor getStringDWOExtractor() const
Definition: DWARFContext.h:345
llvm::DWARFContext::operator=
DWARFContext & operator=(DWARFContext &)=delete
llvm::DWARFContext::ProcessDebugRelocations::Ignore
@ Ignore
llvm::DWARFContext::compile_units
compile_unit_range compile_units()
Get compile units in this context.
Definition: DWARFContext.h:174
llvm::StringMap
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
Definition: StringMap.h:109
llvm::DWARFContext::getMaxDWOVersion
unsigned getMaxDWOVersion()
Definition: DWARFContext.h:272
llvm::DWARFContext::getDebugMacro
const DWARFDebugMacro * getDebugMacro()
Get a pointer to the parsed DebugMacro information object.
Definition: DWARFContext.cpp:892
llvm::DWARFContext::dwo_units
unit_iterator_range dwo_units()
Get all units in the DWO context.
Definition: DWARFContext.h:216
llvm::DWARFContext::verify
bool verify(raw_ostream &OS, DIDumpOptions DumpOpts={}) override
Definition: DWARFContext.cpp:761
llvm::DWARFCompileUnit
Definition: DWARFCompileUnit.h:17
llvm::function_ref
An efficient, type-erasing, non-owning reference to a callable.
Definition: STLFunctionalExtras.h:36
DWARFDebugAranges.h
llvm::DWARFContext::getNormalUnitsVector
const DWARFUnitVector & getNormalUnitsVector()
Definition: DWARFContext.h:161
llvm::DWARFGdbIndex
Definition: DWARFGdbIndex.h:22
llvm::DIDT_ID_Count
@ DIDT_ID_Count
Definition: DIContext.h:163
llvm::DWARFContext::getTypeUnitForHash
DWARFTypeUnit * getTypeUnitForHash(uint16_t Version, uint64_t Hash, bool IsDWO)
Definition: DWARFContext.cpp:696
llvm::DWARFContext::getNumDWOTypeUnits
unsigned getNumDWOTypeUnits()
Get the number of type units in the DWO context.
Definition: DWARFContext.h:240
index
splat index
Definition: README_ALTIVEC.txt:181
llvm::DWARFDebugLoc
Definition: DWARFDebugLoc.h:86
uint64_t
llvm::DWARFContext::getDebugAbbrev
const DWARFDebugAbbrev * getDebugAbbrev()
Get a pointer to the parsed DebugAbbrev object.
Definition: DWARFContext.cpp:806
llvm::CompileUnit
Stores all information relating to a compile unit, be it in its original instance in the object file ...
Definition: DWARFLinkerCompileUnit.h:50
llvm::DWARFContext::getCUAddrSize
uint8_t getCUAddrSize()
Get address size from CUs.
Definition: DWARFContext.cpp:2038
llvm::DWARFContext::dwo_compile_units
compile_unit_range dwo_compile_units()
Get compile units in the DWO context.
Definition: DWARFContext.h:207
DWARFUnit.h
llvm::DILineInfo
A format-neutral container for source line information.
Definition: DIContext.h:31
llvm::DWARFContext::getWarningHandler
function_ref< void(Error)> getWarningHandler()
Definition: DWARFContext.h:417
llvm::is_contained
bool is_contained(R &&Range, const E &Element)
Wrapper function around std::find to detect if an element exists in a container.
Definition: STLExtras.h:1657
llvm::DWARFContext::DIEsForAddress::BlockDIE
DWARFDie BlockDIE
Definition: DWARFContext.h:356
ObjectFile.h
llvm::DWARFContext::isAddressSizeSupported
static bool isAddressSizeSupported(unsigned AddressSize)
Definition: DWARFContext.h:388
llvm::DWARFContext::getUnitAtIndex
DWARFUnit * getUnitAtIndex(unsigned index)
Get the unit at the specified index.
Definition: DWARFContext.h:246
iterator_range.h
function
print Print MemDeps of function
Definition: MemDepPrinter.cpp:83
llvm::DWARFContext::getTUIndex
const DWARFUnitIndex & getTUIndex()
Definition: DWARFContext.cpp:785
llvm::DWARFContext::getDIEsForAddress
DIEsForAddress getDIEsForAddress(uint64_t Address)
Get the compilation unit, the function DIE and lexical block DIE for the given address where applicab...
Definition: DWARFContext.cpp:1033
llvm::DWARFContext::getGdbIndex
DWARFGdbIndex & getGdbIndex()
Definition: DWARFContext.cpp:796
llvm::DWARFContext::getDWOContext
std::shared_ptr< DWARFContext > getDWOContext(StringRef AbsolutePath)
Definition: DWARFContext.cpp:1401
llvm::DWARFContext::~DWARFContext
~DWARFContext()
llvm::DWARFContext::getDebugFrame
Expected< const DWARFDebugFrame * > getDebugFrame()
Get a pointer to the parsed frame information object.
Definition: DWARFContext.cpp:850
llvm::DWARFContext::isLittleEndian
bool isLittleEndian() const
Definition: DWARFContext.h:379
llvm::DWARFContext::getDebugLoc
const DWARFDebugLoc * getDebugLoc()
Get a pointer to the parsed DebugLoc object.
Definition: DWARFContext.cpp:827
RegInfo
Definition: AMDGPUAsmParser.cpp:2388
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::object::ObjectFile
This class is the base class for all object file types.
Definition: ObjectFile.h:227
llvm::DWARFContext::DIEsForAddress::FunctionDIE
DWARFDie FunctionDIE
Definition: DWARFContext.h:355
llvm::DWARFUnitVector::compile_unit_range
decltype(make_filter_range(std::declval< iterator_range >(), isCompileUnit)) compile_unit_range
Definition: DWARFUnit.h:133
llvm::DWARFContext::normal_units
unit_iterator_range normal_units()
Get all normal compile/type units in this context.
Definition: DWARFContext.h:182
llvm::DWARFContext::getLineStringExtractor
DataExtractor getLineStringExtractor() const
Definition: DWARFContext.h:348
llvm::AppleAcceleratorTable
This implements the Apple accelerator table format, a precursor of the DWARF 5 accelerator table form...
Definition: DWARFAcceleratorTable.h:83
llvm::format
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
Definition: Format.h:124
llvm::DWARFContext::getNumDWOCompileUnits
unsigned getNumDWOCompileUnits()
Get the number of compile units in the DWO context.
Definition: DWARFContext.h:234
llvm::DWARFDebugMacro
Definition: DWARFDebugMacro.h:23
llvm::MCRegisterInfo
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
Definition: MCRegisterInfo.h:135
llvm::make_filter_range
iterator_range< filter_iterator< detail::IterOfRange< RangeT >, PredicateT > > make_filter_range(RangeT &&Range, PredicateT Pred)
Convenience function that takes a range of elements and a predicate, and return a new filter_iterator...
Definition: STLExtras.h:501
llvm::DWARFContext::getDIEForOffset
DWARFDie getDIEForOffset(uint64_t Offset)
Get a DIE given an exact offset.
Definition: DWARFContext.cpp:754
llvm::DWARFContext::getCUIndex
const DWARFUnitIndex & getCUIndex()
Definition: DWARFContext.cpp:774
llvm::DWARFContext::getLineInfoForAddress
DILineInfo getLineInfoForAddress(object::SectionedAddress Address, DILineInfoSpecifier Specifier=DILineInfoSpecifier()) override
Definition: DWARFContext.cpp:1256
DIContext.h
llvm::DWARFContext::setMaxVersionIfGreater
void setMaxVersionIfGreater(unsigned Version)
Definition: DWARFContext.h:278
llvm::DWARFContext::getDWOUnitAtIndex
DWARFUnit * getDWOUnitAtIndex(unsigned index)
Get the unit at the specified index for the DWO units.
Definition: DWARFContext.h:252
llvm::DWARFTypeUnit
Definition: DWARFTypeUnit.h:25
uint16_t
llvm::DWARFContext::getRegisterInfo
const MCRegisterInfo * getRegisterInfo() const
Definition: DWARFContext.h:411
llvm::object::OwningBinary
Definition: RuntimeDyld.h:36
DWARFDebugAbbrev.h
llvm::DWARFUnit
Definition: DWARFUnit.h:203
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition: Error.h:155
llvm::AArch64CC::LS
@ LS
Definition: AArch64BaseInfo.h:264
llvm::DWARFContext::getCompileUnitForOffset
DWARFCompileUnit * getCompileUnitForOffset(uint64_t Offset)
Return the compile unit that includes an offset (relative to .debug_info).
Definition: DWARFContext.cpp:1020
DataExtractor.h
llvm::DWARFContext::getRecoverableErrorHandler
function_ref< void(Error)> getRecoverableErrorHandler()
Definition: DWARFContext.h:413
DWARFTypeUnit.h
llvm::LoadedObjectInfo
An inferface for inquiring the load address of a loaded object file to be used by the DIContext imple...
Definition: DIContext.h:253
DWARFUnitIndex.h
llvm::DWARFContext::classof
static bool classof(const DIContext *DICtx)
Definition: DWARFContext.h:134
Binary.h
llvm::DataExtractor
Definition: DataExtractor.h:41
Version
uint64_t Version
Definition: RawMemProfReader.cpp:25
SmallVector.h
llvm::sys::IsLittleEndianHost
static const bool IsLittleEndianHost
Definition: SwapByteOrder.h:101
llvm::DWARFContext::getDWARFObj
const DWARFObject & getDWARFObj() const
Definition: DWARFContext.h:132
llvm::object::SectionedAddress
Definition: ObjectFile.h:143
llvm::iterator_range
A range adaptor for a pair of iterators.
Definition: iterator_range.h:30
llvm::DWARFDebugLine::LineTable
Definition: DWARFDebugLine.h:229
llvm::isCompileUnit
bool isCompileUnit(const std::unique_ptr< DWARFUnit > &U)
Definition: DWARFUnit.h:529
llvm::DWARFContext::getCompileUnitForAddress
DWARFCompileUnit * getCompileUnitForAddress(uint64_t Address)
Return the compile unit which contains instruction with provided address.
Definition: DWARFContext.cpp:1026
llvm::DWARFUnitVector::iterator_range
llvm::iterator_range< typename UnitVector::iterator > iterator_range
Definition: DWARFUnit.h:130
llvm::DWARFDie
Utility class that carries the DWARF compile/type unit and the debug info entry in an object.
Definition: DWARFDie.h:43
llvm::DWARFDebugNames
.debug_names section consists of one or more units.
Definition: DWARFAcceleratorTable.h:231
llvm::DWARFContext::DWARFContext
DWARFContext(std::unique_ptr< const DWARFObject > DObj, std::string DWPName="", std::function< void(Error)> RecoverableErrorHandler=WithColor::defaultErrorHandler, std::function< void(Error)> WarningHandler=WithColor::defaultWarningHandler)
Definition: DWARFContext.cpp:67
llvm::DWARFContext::DIEsForAddress
Wraps the returned DIEs for a given address.
Definition: DWARFContext.h:353
llvm::DWARFContext::ProcessDebugRelocations
ProcessDebugRelocations
Definition: DWARFContext.h:419
llvm::DWARFContext::isSupportedVersion
static bool isSupportedVersion(unsigned version)
Definition: DWARFContext.h:381
llvm::DWARFDebugAranges
Definition: DWARFDebugAranges.h:21
llvm::raw_string_ostream::str
std::string & str()
Returns the string's reference.
Definition: raw_ostream.h:650
CU
Definition: AArch64AsmBackend.cpp:504
llvm::DWARFContext::getAppleTypes
const AppleAcceleratorTable & getAppleTypes()
Get a reference to the parsed accelerator table object.
Definition: DWARFContext.cpp:940
llvm::DWARFContext::dump
void dump(raw_ostream &OS, DIDumpOptions DumpOpts, std::array< Optional< uint64_t >, DIDT_ID_Count > DumpOffsets)
Dump a textual representation to OS.
Definition: DWARFContext.cpp:346
llvm::DWARFContext::getAppleNamespaces
const AppleAcceleratorTable & getAppleNamespaces()
Get a reference to the parsed accelerator table object.
Definition: DWARFContext.cpp:945
File
Instrumentation for Order File
Definition: InstrOrderFile.cpp:205
llvm::DWARFContext::loadRegisterInfo
Error loadRegisterInfo(const object::ObjectFile &Obj)
Loads register info for the architecture of the provided object file.
Definition: DWARFContext.cpp:2021
llvm::DWARFContext::getMaxSupportedVersion
static unsigned getMaxSupportedVersion()
Definition: DWARFContext.h:380
llvm::MachO::SectionType
SectionType
These are the section type and attributes fields.
Definition: MachO.h:120
llvm::DIContext::getKind
DIContextKind getKind() const
Definition: DIContext.h:224
llvm::DIDumpOptions
Container for dump options that control which debug information will be dumped.
Definition: DIContext.h:180
llvm::DWARFUnitVector
Describe a collection of units.
Definition: DWARFUnit.h:120