LLVM 22.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
14#include "llvm/ADT/StringMap.h"
15#include "llvm/ADT/StringRef.h"
21#include "llvm/Object/Binary.h"
25#include "llvm/Support/Error.h"
27#include <cstdint>
28#include <memory>
29#include <mutex>
30
31namespace llvm {
32
33class MemoryBuffer;
38class DWARFDebugFrame;
39class DWARFDebugLoc;
40class DWARFDebugMacro;
41class DWARFDebugNames;
42class DWARFGdbIndex;
43class DWARFTypeUnit;
44class DWARFUnitIndex;
45
46/// DWARFContext
47/// This data structure is the top level entity that deals with dwarf debug
48/// information parsing. The actual data is supplied through DWARFObj.
50public:
51 /// DWARFContextState
52 /// This structure contains all member variables for DWARFContext that need
53 /// to be protected in multi-threaded environments. Threading support can be
54 /// enabled by setting the ThreadSafe to true when constructing a
55 /// DWARFContext to allow DWARRContext to be able to be used in a
56 /// multi-threaded environment, or not enabled to allow for maximum
57 /// performance in single threaded environments.
59 protected:
60 /// Helper enum to distinguish between macro[.dwo] and macinfo[.dwo]
61 /// section.
68
70 public:
72 virtual ~DWARFContextState() = default;
74 virtual DWARFUnitVector &getDWOUnits(bool Lazy = false) = 0;
75 virtual const DWARFDebugAbbrev *getDebugAbbrevDWO() = 0;
76 virtual const DWARFUnitIndex &getCUIndex() = 0;
77 virtual const DWARFUnitIndex &getTUIndex() = 0;
78 virtual DWARFGdbIndex &getGdbIndex() = 0;
79 virtual const DWARFDebugAbbrev *getDebugAbbrev() = 0;
80 virtual const DWARFDebugLoc *getDebugLoc() = 0;
81 virtual const DWARFDebugAranges *getDebugAranges() = 0;
84 function_ref<void(Error)> RecoverableErrHandler) = 0;
85 virtual void clearLineTableForUnit(DWARFUnit *U) = 0;
88 virtual const DWARFDebugMacro *getDebugMacinfo() = 0;
89 virtual const DWARFDebugMacro *getDebugMacinfoDWO() = 0;
90 virtual const DWARFDebugMacro *getDebugMacro() = 0;
91 virtual const DWARFDebugMacro *getDebugMacroDWO() = 0;
92 virtual const DWARFDebugNames &getDebugNames() = 0;
96 virtual const AppleAcceleratorTable &getAppleObjC() = 0;
97 virtual std::shared_ptr<DWARFContext>
98 getDWOContext(StringRef AbsolutePath) = 0;
100 getTypeUnitMap(bool IsDWO) = 0;
101 virtual bool isThreadSafe() const = 0;
102
103 /// Parse a macro[.dwo] or macinfo[.dwo] section.
104 LLVM_ABI std::unique_ptr<DWARFDebugMacro>
106 };
107 friend class DWARFContextState;
108
109private:
110 /// All important state for a DWARFContext that needs to be threadsafe needs
111 /// to go into DWARFContextState.
112 std::unique_ptr<DWARFContextState> State;
113
114 /// The maximum DWARF version of all units.
115 unsigned MaxVersion = 0;
116
117 std::function<void(Error)> RecoverableErrorHandler =
119 std::function<void(Error)> WarningHandler = WithColor::defaultWarningHandler;
120
121 /// Read compile units from the debug_info.dwo section (if necessary)
122 /// and type units from the debug_types.dwo section (if necessary)
123 /// and store them in DWOUnits.
124 /// If \p Lazy is true, set up to parse but don't actually parse them.
125 enum { EagerParse = false, LazyParse = true };
126 DWARFUnitVector &getDWOUnits(bool Lazy = false);
127
128 std::unique_ptr<const DWARFObject> DObj;
129
130 // When set parses debug_info.dwo/debug_abbrev.dwo manually and populates CU
131 // Index, and TU Index for DWARF5.
132 bool ParseCUTUIndexManually = false;
133
134public:
135 DWARFContext(std::unique_ptr<const DWARFObject> DObj,
136 std::string DWPName = "",
137 std::function<void(Error)> RecoverableErrorHandler =
139 std::function<void(Error)> WarningHandler =
141 bool ThreadSafe = false);
142 ~DWARFContext() override;
143
146
147 const DWARFObject &getDWARFObj() const { return *DObj; }
148
149 static bool classof(const DIContext *DICtx) {
150 return DICtx->getKind() == CK_DWARF;
151 }
152
153 /// Dump a textual representation to \p OS. If any \p DumpOffsets are present,
154 /// dump only the record at the specified offset.
155 void dump(raw_ostream &OS, DIDumpOptions DumpOpts,
156 std::array<std::optional<uint64_t>, DIDT_ID_Count> DumpOffsets);
157
158 void dump(raw_ostream &OS, DIDumpOptions DumpOpts) override {
159 std::array<std::optional<uint64_t>, DIDT_ID_Count> DumpOffsets;
160 dump(OS, DumpOpts, DumpOffsets);
161 }
162
163 bool verify(raw_ostream &OS, DIDumpOptions DumpOpts = {}) override;
164
167
168 /// Get units from .debug_info in this context.
170 DWARFUnitVector &NormalUnits = State->getNormalUnits();
171 return unit_iterator_range(NormalUnits.begin(),
172 NormalUnits.begin() +
173 NormalUnits.getNumInfoUnits());
174 }
175
177 return State->getNormalUnits();
178 }
179
180 /// Get units from .debug_types in this context.
182 DWARFUnitVector &NormalUnits = State->getNormalUnits();
183 return unit_iterator_range(
184 NormalUnits.begin() + NormalUnits.getNumInfoUnits(), NormalUnits.end());
185 }
186
187 /// Get compile units in this context.
191
192 // If you want type_units(), it'll need to be a concat iterator of a filter of
193 // TUs in info_section + all the (all type) units in types_section
194
195 /// Get all normal compile/type units in this context.
197 DWARFUnitVector &NormalUnits = State->getNormalUnits();
198 return unit_iterator_range(NormalUnits.begin(), NormalUnits.end());
199 }
200
201 /// Get units from .debug_info..dwo in the DWO context.
203 DWARFUnitVector &DWOUnits = State->getDWOUnits();
204 return unit_iterator_range(DWOUnits.begin(),
205 DWOUnits.begin() + DWOUnits.getNumInfoUnits());
206 }
207
209 return State->getDWOUnits();
210 }
211
212 /// Return true of this DWARF context is a DWP file.
213 bool isDWP() const;
214
215 /// Get units from .debug_types.dwo in the DWO context.
217 DWARFUnitVector &DWOUnits = State->getDWOUnits();
218 return unit_iterator_range(DWOUnits.begin() + DWOUnits.getNumInfoUnits(),
219 DWOUnits.end());
220 }
221
222 /// Get compile units in the DWO context.
226
227 // If you want dwo_type_units(), it'll need to be a concat iterator of a
228 // filter of TUs in dwo_info_section + all the (all type) units in
229 // dwo_types_section.
230
231 /// Get all units in the DWO context.
233 DWARFUnitVector &DWOUnits = State->getDWOUnits();
234 return unit_iterator_range(DWOUnits.begin(), DWOUnits.end());
235 }
236
237 /// Get the number of compile units in this context.
239 return State->getNormalUnits().getNumInfoUnits();
240 }
241
242 /// Get the number of type units in this context.
243 unsigned getNumTypeUnits() {
244 return State->getNormalUnits().getNumTypesUnits();
245 }
246
247 /// Get the number of compile units in the DWO context.
249 return State->getDWOUnits().getNumInfoUnits();
250 }
251
252 /// Get the number of type units in the DWO context.
254 return State->getDWOUnits().getNumTypesUnits();
255 }
256
257 /// Get the unit at the specified index.
258 DWARFUnit *getUnitAtIndex(unsigned index) {
259 return State->getNormalUnits()[index].get();
260 }
261
262 /// Get the unit at the specified index for the DWO units.
263 DWARFUnit *getDWOUnitAtIndex(unsigned index) {
264 return State->getDWOUnits()[index].get();
265 }
266
267 DWARFCompileUnit *getDWOCompileUnitForHash(uint64_t Hash);
268 DWARFTypeUnit *getTypeUnitForHash(uint64_t Hash, bool IsDWO);
269
270 /// Return the DWARF unit that includes an offset (relative to .debug_info).
272
273 /// Return the compile unit that includes an offset (relative to .debug_info).
274 DWARFCompileUnit *getCompileUnitForOffset(uint64_t Offset);
275
276 /// Get a DIE given an exact offset.
277 DWARFDie getDIEForOffset(uint64_t Offset);
278
279 unsigned getMaxVersion() {
280 // Ensure info units have been parsed to discover MaxVersion
282 return MaxVersion;
283 }
284
285 unsigned getMaxDWOVersion() {
286 // Ensure DWO info units have been parsed to discover MaxVersion
288 return MaxVersion;
289 }
290
292 if (Version > MaxVersion)
293 MaxVersion = Version;
294 }
295
296 const DWARFUnitIndex &getCUIndex();
297 DWARFGdbIndex &getGdbIndex();
298 const DWARFUnitIndex &getTUIndex();
299
300 /// Get a pointer to the parsed DebugAbbrev object.
301 const DWARFDebugAbbrev *getDebugAbbrev();
302
303 /// Get a pointer to the parsed DebugLoc object.
304 const DWARFDebugLoc *getDebugLoc();
305
306 /// Get a pointer to the parsed dwo abbreviations object.
307 const DWARFDebugAbbrev *getDebugAbbrevDWO();
308
309 /// Get a pointer to the parsed DebugAranges object.
310 const DWARFDebugAranges *getDebugAranges();
311
312 /// Get a pointer to the parsed frame information object.
313 Expected<const DWARFDebugFrame *> getDebugFrame();
314
315 /// Get a pointer to the parsed eh frame information object.
317
318 /// Get a pointer to the parsed DebugMacinfo information object.
319 const DWARFDebugMacro *getDebugMacinfo();
320
321 /// Get a pointer to the parsed DebugMacinfoDWO information object.
322 const DWARFDebugMacro *getDebugMacinfoDWO();
323
324 /// Get a pointer to the parsed DebugMacro information object.
325 const DWARFDebugMacro *getDebugMacro();
326
327 /// Get a pointer to the parsed DebugMacroDWO information object.
328 const DWARFDebugMacro *getDebugMacroDWO();
329
330 /// Get a reference to the parsed accelerator table object.
331 const DWARFDebugNames &getDebugNames();
332
333 /// Get a reference to the parsed accelerator table object.
334 const AppleAcceleratorTable &getAppleNames();
335
336 /// Get a reference to the parsed accelerator table object.
337 const AppleAcceleratorTable &getAppleTypes();
338
339 /// Get a reference to the parsed accelerator table object.
340 const AppleAcceleratorTable &getAppleNamespaces();
341
342 /// Get a reference to the parsed accelerator table object.
343 const AppleAcceleratorTable &getAppleObjC();
344
345 /// Get a pointer to a parsed line table corresponding to a compile unit.
346 /// Report any parsing issues as warnings on stderr.
347 const DWARFDebugLine::LineTable *getLineTableForUnit(DWARFUnit *U);
348
349 /// Get a pointer to a parsed line table corresponding to a compile unit.
350 /// Report any recoverable parsing problems using the handler.
352 getLineTableForUnit(DWARFUnit *U,
353 function_ref<void(Error)> RecoverableErrorHandler);
354
355 // Clear the line table object corresponding to a compile unit for memory
356 // management purpose. When it's referred to again, it'll be re-populated.
357 void clearLineTableForUnit(DWARFUnit *U);
358
360 return DataExtractor(DObj->getStrSection(), false, 0);
361 }
363 return DataExtractor(DObj->getStrDWOSection(), false, 0);
364 }
366 return DataExtractor(DObj->getLineStrSection(), false, 0);
367 }
368
369 /// Wraps the returned DIEs for a given address.
374 explicit operator bool() const { return CompileUnit != nullptr; }
375 };
376
377 /// Get the compilation unit, the function DIE and lexical block DIE for the
378 /// given address where applicable.
379 /// TODO: change input parameter from "uint64_t Address"
380 /// into "SectionedAddress Address"
381 /// \param[in] CheckDWO If this is false then only search for address matches
382 /// in the current context's DIEs. If this is true, then each
383 /// DWARFUnit that has a DWO file will have the debug info in the
384 /// DWO file searched as well. This allows for lookups to succeed
385 /// by searching the split DWARF debug info when using the main
386 /// executable's debug info.
387 DIEsForAddress getDIEsForAddress(uint64_t Address, bool CheckDWO = false);
388
389 std::optional<DILineInfo> getLineInfoForAddress(
391 DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
392 std::optional<DILineInfo>
393 getLineInfoForDataAddress(object::SectionedAddress Address) override;
394 DILineInfoTable getLineInfoForAddressRange(
396 DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
397 DIInliningInfo getInliningInfoForAddress(
399 DILineInfoSpecifier Specifier = DILineInfoSpecifier()) override;
400
401 std::vector<DILocal>
402 getLocalsForAddress(object::SectionedAddress Address) override;
403
404 bool isLittleEndian() const { return DObj->isLittleEndian(); }
405 static unsigned getMaxSupportedVersion() { return 5; }
406 static bool isSupportedVersion(unsigned version) {
407 return version >= 2 && version <= getMaxSupportedVersion();
408 }
409
411 return {2, 4, 8};
412 }
413 static bool isAddressSizeSupported(unsigned AddressSize) {
414 return llvm::is_contained(getSupportedAddressSizes(), AddressSize);
415 }
416 template <typename... Ts>
417 static Error checkAddressSizeSupported(unsigned AddressSize,
418 std::error_code EC, char const *Fmt,
419 const Ts &...Vals) {
420 if (isAddressSizeSupported(AddressSize))
421 return Error::success();
422 std::string Buffer;
423 raw_string_ostream Stream(Buffer);
424 Stream << format(Fmt, Vals...)
425 << " has unsupported address size: " << AddressSize
426 << " (supported are ";
427 ListSeparator LS;
429 Stream << LS << Size;
430 Stream << ')';
431 return make_error<StringError>(Buffer, EC);
432 }
433
434 std::shared_ptr<DWARFContext> getDWOContext(StringRef AbsolutePath);
435
437 return RecoverableErrorHandler;
438 }
439
440 function_ref<void(Error)> getWarningHandler() { return WarningHandler; }
441
443
444 static std::unique_ptr<DWARFContext>
445 create(const object::ObjectFile &Obj,
446 ProcessDebugRelocations RelocAction = ProcessDebugRelocations::Process,
447 const LoadedObjectInfo *L = nullptr, std::string DWPName = "",
448 std::function<void(Error)> RecoverableErrorHandler =
450 std::function<void(Error)> WarningHandler =
452 bool ThreadSafe = false);
453
454 static std::unique_ptr<DWARFContext>
455 create(const StringMap<std::unique_ptr<MemoryBuffer>> &Sections,
456 uint8_t AddrSize, bool isLittleEndian = sys::IsLittleEndianHost,
457 std::function<void(Error)> RecoverableErrorHandler =
459 std::function<void(Error)> WarningHandler =
461 bool ThreadSafe = false);
462
463 /// Get address size from CUs.
464 /// TODO: refactor compile_units() to make this const.
465 uint8_t getCUAddrSize();
466
468 return getDWARFObj().getFile()->getArch();
469 }
470
471 /// Return the compile unit which contains instruction with provided
472 /// address.
473 /// TODO: change input parameter from "uint64_t Address"
474 /// into "SectionedAddress Address"
475 DWARFCompileUnit *getCompileUnitForCodeAddress(uint64_t Address);
476
477 /// Return the compile unit which contains data with the provided address.
478 /// Note: This is more expensive than `getCompileUnitForAddress`, as if
479 /// `Address` isn't found in the CU ranges (which is cheap), then it falls
480 /// back to an expensive O(n) walk of all CU's looking for data that spans the
481 /// address.
482 /// TODO: change input parameter from "uint64_t Address" into
483 /// "SectionedAddress Address"
484 DWARFCompileUnit *getCompileUnitForDataAddress(uint64_t Address);
485
486 /// Returns whether CU/TU should be populated manually. TU Index populated
487 /// manually only for DWARF5.
488 bool getParseCUTUIndexManually() const { return ParseCUTUIndexManually; }
489
490 /// Sets whether CU/TU should be populated manually. TU Index populated
491 /// manually only for DWARF5.
492 void setParseCUTUIndexManually(bool PCUTU) { ParseCUTUIndexManually = PCUTU; }
493
494private:
495 void addLocalsForDie(DWARFCompileUnit *CU, DWARFDie Subprogram, DWARFDie Die,
496 std::vector<DILocal> &Result);
497};
498
499} // end namespace llvm
500
501#endif // LLVM_DEBUGINFO_DWARF_DWARFCONTEXT_H
This file defines the StringMap class.
#define LLVM_ABI
Definition Compiler.h:213
static DebugLoc getDebugLoc(MachineBasicBlock::instr_iterator FirstMI, MachineBasicBlock::instr_iterator LastMI)
Return the first found DebugLoc that has a DILocation, given a range of instructions.
ppc ctr loops verify
This file defines the SmallVector class.
This file contains some functions that are useful when dealing with strings.
This implements the Apple accelerator table format, a precursor of the DWARF 5 accelerator table form...
DIContextKind getKind() const
Definition DIContext.h:247
DIContext(DIContextKind K)
Definition DIContext.h:244
A format-neutral container for inlined code description.
Definition DIContext.h:94
DWARFContextState This structure contains all member variables for DWARFContext that need to be prote...
virtual void clearLineTableForUnit(DWARFUnit *U)=0
virtual DWARFGdbIndex & getGdbIndex()=0
virtual Expected< const DWARFDebugFrame * > getEHFrame()=0
virtual const DWARFUnitIndex & getCUIndex()=0
MacroSecType
Helper enum to distinguish between macro[.dwo] and macinfo[.dwo] section.
virtual bool isThreadSafe() const =0
virtual const DWARFUnitIndex & getTUIndex()=0
virtual const DWARFDebugMacro * getDebugMacinfoDWO()=0
virtual const DWARFDebugMacro * getDebugMacroDWO()=0
virtual const DenseMap< uint64_t, DWARFTypeUnit * > & getTypeUnitMap(bool IsDWO)=0
virtual Expected< const DWARFDebugLine::LineTable * > getLineTableForUnit(DWARFUnit *U, function_ref< void(Error)> RecoverableErrHandler)=0
virtual const DWARFDebugAbbrev * getDebugAbbrevDWO()=0
virtual const DWARFDebugMacro * getDebugMacro()=0
virtual const DWARFDebugAranges * getDebugAranges()=0
virtual const AppleAcceleratorTable & getAppleNames()=0
LLVM_ABI std::unique_ptr< DWARFDebugMacro > parseMacroOrMacinfo(MacroSecType SectionType)
Parse a macro[.dwo] or macinfo[.dwo] section.
virtual Expected< const DWARFDebugFrame * > getDebugFrame()=0
virtual DWARFUnitVector & getDWOUnits(bool Lazy=false)=0
virtual const DWARFDebugLoc * getDebugLoc()=0
virtual DWARFUnitVector & getNormalUnits()=0
virtual const DWARFDebugAbbrev * getDebugAbbrev()=0
virtual const DWARFDebugNames & getDebugNames()=0
virtual const AppleAcceleratorTable & getAppleTypes()=0
virtual const AppleAcceleratorTable & getAppleNamespaces()=0
virtual const DWARFDebugMacro * getDebugMacinfo()=0
virtual const AppleAcceleratorTable & getAppleObjC()=0
virtual std::shared_ptr< DWARFContext > getDWOContext(StringRef AbsolutePath)=0
DWARFContext This data structure is the top level entity that deals with dwarf debug information pars...
static bool isSupportedVersion(unsigned version)
Triple::ArchType getArch() const
function_ref< void(Error)> getRecoverableErrorHandler()
unsigned getNumCompileUnits()
Get the number of compile units in this context.
~DWARFContext() override
DWARFUnitVector::compile_unit_range compile_unit_range
static SmallVector< uint8_t, 3 > getSupportedAddressSizes()
DWARFContext(std::unique_ptr< const DWARFObject > DObj, std::string DWPName="", std::function< void(Error)> RecoverableErrorHandler=WithColor::defaultErrorHandler, std::function< void(Error)> WarningHandler=WithColor::defaultWarningHandler, bool ThreadSafe=false)
unsigned getNumTypeUnits()
Get the number of type units in this context.
DWARFUnitVector::iterator_range unit_iterator_range
static bool classof(const DIContext *DICtx)
compile_unit_range compile_units()
Get compile units in this context.
unsigned getMaxVersion()
DWARFUnit * getDWOUnitAtIndex(unsigned index)
Get the unit at the specified index for the DWO units.
DataExtractor getStringExtractor() const
void setParseCUTUIndexManually(bool PCUTU)
Sets whether CU/TU should be populated manually.
unsigned getNumDWOTypeUnits()
Get the number of type units in the DWO context.
static Error checkAddressSizeSupported(unsigned AddressSize, std::error_code EC, char const *Fmt, const Ts &...Vals)
function_ref< void(Error)> getWarningHandler()
bool isLittleEndian() const
DWARFUnit * getUnitAtIndex(unsigned index)
Get the unit at the specified index.
DWARFContext & operator=(DWARFContext &)=delete
void setMaxVersionIfGreater(unsigned Version)
compile_unit_range dwo_compile_units()
Get compile units in the DWO context.
const DWARFUnitVector & getNormalUnitsVector()
unit_iterator_range dwo_types_section_units()
Get units from .debug_types.dwo in the DWO context.
void dump(raw_ostream &OS, DIDumpOptions DumpOpts, std::array< std::optional< uint64_t >, DIDT_ID_Count > DumpOffsets)
Dump a textual representation to OS.
unit_iterator_range normal_units()
Get all normal compile/type units in this context.
static unsigned getMaxSupportedVersion()
unit_iterator_range types_section_units()
Get units from .debug_types in this context.
void dump(raw_ostream &OS, DIDumpOptions DumpOpts) override
unsigned getNumDWOCompileUnits()
Get the number of compile units in the DWO context.
DWARFContext(DWARFContext &)=delete
DataExtractor getLineStringExtractor() const
unit_iterator_range info_section_units()
Get units from .debug_info in this context.
bool getParseCUTUIndexManually() const
Returns whether CU/TU should be populated manually.
unit_iterator_range dwo_info_section_units()
Get units from .debug_info..dwo in the DWO context.
DataExtractor getStringDWOExtractor() const
static bool isAddressSizeSupported(unsigned AddressSize)
const DWARFUnitVector & getDWOUnitsVector()
unit_iterator_range dwo_units()
Get all units in the DWO context.
const DWARFObject & getDWARFObj() const
unsigned getMaxDWOVersion()
A parsed .debug_frame or .eh_frame section.
.debug_names section consists of one or more units.
Utility class that carries the DWARF compile/type unit and the debug info entry in an object.
Definition DWARFDie.h:43
Describe a collection of units.
Definition DWARFUnit.h:130
unsigned getNumInfoUnits() const
Returns number of units from all .debug_info[.dwo] sections.
Definition DWARFUnit.h:171
llvm::iterator_range< typename UnitVector::iterator > iterator_range
Definition DWARFUnit.h:140
decltype(make_filter_range(std::declval< iterator_range >(), isCompileUnit)) compile_unit_range
Definition DWARFUnit.h:142
Lightweight error class with error context and mandatory checking.
Definition Error.h:159
static ErrorSuccess success()
Create a success value.
Definition Error.h:336
Tagged union holding either a T or a Error.
Definition Error.h:485
A helper class to return the specified delimiter string after the first invocation of operator String...
An inferface for inquiring the load address of a loaded object file to be used by the DIContext imple...
Definition DIContext.h:280
This interface provides simple read-only access to a block of memory, and provides simple methods for...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
Definition StringMap.h:133
StringRef - Represent a constant reference to a string, i.e.
Definition StringRef.h:55
static LLVM_ABI void defaultWarningHandler(Error Warning)
Implement default handling for Warning.
static LLVM_ABI void defaultErrorHandler(Error Err)
Implement default handling for Error.
An efficient, type-erasing, non-owning reference to a callable.
This class is the base class for all object file types.
Definition ObjectFile.h:231
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
A raw_ostream that writes to an std::string.
constexpr bool IsLittleEndianHost
This is an optimization pass for GlobalISel generic memory operations.
void dump(const SparseBitVector< ElementSize > &LHS, raw_ostream &out)
@ Offset
Definition DWP.cpp:477
SmallVector< std::pair< uint64_t, DILineInfo >, 16 > DILineInfoTable
Definition DIContext.h:91
static CompileUnit * getUnitForOffset(const UnitListTy &Units, uint64_t Offset)
Similar to DWARFUnitSection::getUnitForOffset(), but returning our CompileUnit object instead.
FunctionAddr VTableAddr uintptr_t uintptr_t Version
Definition InstrProf.h:302
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:552
format_object< Ts... > format(const char *Fmt, const Ts &... Vals)
These are helper functions used to produce formatted output.
Definition Format.h:126
Error make_error(ArgTs &&... Args)
Make a Error instance representing failure using the given error info type.
Definition Error.h:340
bool is_contained(R &&Range, const E &Element)
Returns true if Element is found in Range.
Definition STLExtras.h:1877
@ DIDT_ID_Count
Definition DIContext.h:179
bool isCompileUnit(const std::unique_ptr< DWARFUnit > &U)
Definition DWARFUnit.h:599
Container for dump options that control which debug information will be dumped.
Definition DIContext.h:196
Controls which fields of DILineInfo container should be filled with data.
Definition DIContext.h:146
Wraps the returned DIEs for a given address.