LLVM  16.0.0git
DWARFDebugLoc.cpp
Go to the documentation of this file.
1 //===- DWARFDebugLoc.cpp --------------------------------------------------===//
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 
10 #include "llvm/ADT/StringRef.h"
18 #include "llvm/Support/Format.h"
20 #include <algorithm>
21 #include <cinttypes>
22 #include <cstdint>
23 
24 using namespace llvm;
26 
27 namespace llvm {
28 class DWARFObject;
29 }
30 
31 namespace {
32 class DWARFLocationInterpreter {
33  std::optional<object::SectionedAddress> Base;
34  std::function<std::optional<object::SectionedAddress>(uint32_t)> LookupAddr;
35 
36 public:
37  DWARFLocationInterpreter(
38  std::optional<object::SectionedAddress> Base,
39  std::function<std::optional<object::SectionedAddress>(uint32_t)>
40  LookupAddr)
41  : Base(Base), LookupAddr(std::move(LookupAddr)) {}
42 
44  Interpret(const DWARFLocationEntry &E);
45 };
46 } // namespace
47 
48 static Error createResolverError(uint32_t Index, unsigned Kind) {
49  return make_error<ResolverError>(Index, (dwarf::LoclistEntries)Kind);
50 }
51 
53 DWARFLocationInterpreter::Interpret(const DWARFLocationEntry &E) {
54  switch (E.Kind) {
55  case dwarf::DW_LLE_end_of_list:
56  return std::nullopt;
57  case dwarf::DW_LLE_base_addressx: {
58  Base = LookupAddr(E.Value0);
59  if (!Base)
60  return createResolverError(E.Value0, E.Kind);
61  return std::nullopt;
62  }
63  case dwarf::DW_LLE_startx_endx: {
64  std::optional<SectionedAddress> LowPC = LookupAddr(E.Value0);
65  if (!LowPC)
66  return createResolverError(E.Value0, E.Kind);
67  std::optional<SectionedAddress> HighPC = LookupAddr(E.Value1);
68  if (!HighPC)
69  return createResolverError(E.Value1, E.Kind);
71  DWARFAddressRange{LowPC->Address, HighPC->Address, LowPC->SectionIndex},
72  E.Loc};
73  }
74  case dwarf::DW_LLE_startx_length: {
75  std::optional<SectionedAddress> LowPC = LookupAddr(E.Value0);
76  if (!LowPC)
77  return createResolverError(E.Value0, E.Kind);
78  return DWARFLocationExpression{DWARFAddressRange{LowPC->Address,
79  LowPC->Address + E.Value1,
80  LowPC->SectionIndex},
81  E.Loc};
82  }
83  case dwarf::DW_LLE_offset_pair: {
84  if (!Base) {
86  "Unable to resolve location list offset pair: "
87  "Base address not defined");
88  }
89  DWARFAddressRange Range{Base->Address + E.Value0, Base->Address + E.Value1,
90  Base->SectionIndex};
91  if (Range.SectionIndex == SectionedAddress::UndefSection)
92  Range.SectionIndex = E.SectionIndex;
93  return DWARFLocationExpression{Range, E.Loc};
94  }
95  case dwarf::DW_LLE_default_location:
96  return DWARFLocationExpression{std::nullopt, E.Loc};
97  case dwarf::DW_LLE_base_address:
98  Base = SectionedAddress{E.Value0, E.SectionIndex};
99  return std::nullopt;
100  case dwarf::DW_LLE_start_end:
102  DWARFAddressRange{E.Value0, E.Value1, E.SectionIndex}, E.Loc};
103  case dwarf::DW_LLE_start_length:
105  DWARFAddressRange{E.Value0, E.Value0 + E.Value1, E.SectionIndex},
106  E.Loc};
107  default:
108  llvm_unreachable("unreachable locations list kind");
109  }
110 }
111 
112 static void dumpExpression(raw_ostream &OS, DIDumpOptions DumpOpts,
113  ArrayRef<uint8_t> Data, bool IsLittleEndian,
114  unsigned AddressSize, const MCRegisterInfo *MRI,
115  DWARFUnit *U) {
116  DWARFDataExtractor Extractor(Data, IsLittleEndian, AddressSize);
117  // Note. We do not pass any format to DWARFExpression, even if the
118  // corresponding unit is known. For now, there is only one operation,
119  // DW_OP_call_ref, which depends on the format; it is rarely used, and
120  // is unexpected in location tables.
121  DWARFExpression(Extractor, AddressSize).print(OS, DumpOpts, MRI, U);
122 }
123 
125  uint64_t *Offset, raw_ostream &OS, std::optional<SectionedAddress> BaseAddr,
126  const MCRegisterInfo *MRI, const DWARFObject &Obj, DWARFUnit *U,
127  DIDumpOptions DumpOpts, unsigned Indent) const {
128  DWARFLocationInterpreter Interp(
129  BaseAddr, [U](uint32_t Index) -> std::optional<SectionedAddress> {
130  if (U)
131  return U->getAddrOffsetSectionItem(Index);
132  return std::nullopt;
133  });
134  OS << format("0x%8.8" PRIx64 ": ", *Offset);
135  Error E = visitLocationList(Offset, [&](const DWARFLocationEntry &E) {
136  Expected<std::optional<DWARFLocationExpression>> Loc = Interp.Interpret(E);
137  if (!Loc || DumpOpts.DisplayRawContents)
138  dumpRawEntry(E, OS, Indent, DumpOpts, Obj);
139  if (Loc && *Loc) {
140  OS << "\n";
141  OS.indent(Indent);
142  if (DumpOpts.DisplayRawContents)
143  OS << " => ";
144 
145  DIDumpOptions RangeDumpOpts(DumpOpts);
146  RangeDumpOpts.DisplayRawContents = false;
147  if (Loc.get()->Range)
148  Loc.get()->Range->dump(OS, Data.getAddressSize(), RangeDumpOpts, &Obj);
149  else
150  OS << "<default>";
151  }
152  if (!Loc)
153  consumeError(Loc.takeError());
154 
155  if (E.Kind != dwarf::DW_LLE_base_address &&
156  E.Kind != dwarf::DW_LLE_base_addressx &&
157  E.Kind != dwarf::DW_LLE_end_of_list) {
158  OS << ": ";
159  dumpExpression(OS, DumpOpts, E.Loc, Data.isLittleEndian(),
160  Data.getAddressSize(), MRI, U);
161  }
162  return true;
163  });
164  if (E) {
166  return false;
167  }
168  return true;
169 }
170 
172  uint64_t Offset, std::optional<SectionedAddress> BaseAddr,
173  std::function<std::optional<SectionedAddress>(uint32_t)> LookupAddr,
174  function_ref<bool(Expected<DWARFLocationExpression>)> Callback) const {
175  DWARFLocationInterpreter Interp(BaseAddr, std::move(LookupAddr));
176  return visitLocationList(&Offset, [&](const DWARFLocationEntry &E) {
177  Expected<std::optional<DWARFLocationExpression>> Loc = Interp.Interpret(E);
178  if (!Loc)
179  return Callback(Loc.takeError());
180  if (*Loc)
181  return Callback(**Loc);
182  return true;
183  });
184 }
185 
187  const DWARFObject &Obj, DIDumpOptions DumpOpts,
188  std::optional<uint64_t> DumpOffset) const {
189  auto BaseAddr = std::nullopt;
190  unsigned Indent = 12;
191  if (DumpOffset) {
192  dumpLocationList(&*DumpOffset, OS, BaseAddr, MRI, Obj, nullptr, DumpOpts,
193  Indent);
194  } else {
195  uint64_t Offset = 0;
196  StringRef Separator;
197  bool CanContinue = true;
198  while (CanContinue && Data.isValidOffset(Offset)) {
199  OS << Separator;
200  Separator = "\n";
201 
202  CanContinue = dumpLocationList(&Offset, OS, BaseAddr, MRI, Obj, nullptr,
203  DumpOpts, Indent);
204  OS << '\n';
205  }
206  }
207 }
208 
210  uint64_t *Offset,
211  function_ref<bool(const DWARFLocationEntry &)> Callback) const {
212  DataExtractor::Cursor C(*Offset);
213  while (true) {
214  uint64_t SectionIndex;
216  uint64_t Value1 = Data.getRelocatedAddress(C, &SectionIndex);
217 
219 
220  // The end of any given location list is marked by an end of list entry,
221  // which consists of a 0 for the beginning address offset and a 0 for the
222  // ending address offset. A beginning offset of 0xff...f marks the base
223  // address selection entry.
224  if (Value0 == 0 && Value1 == 0) {
225  E.Kind = dwarf::DW_LLE_end_of_list;
226  } else if (Value0 == (Data.getAddressSize() == 4 ? -1U : -1ULL)) {
227  E.Kind = dwarf::DW_LLE_base_address;
228  E.Value0 = Value1;
229  E.SectionIndex = SectionIndex;
230  } else {
231  E.Kind = dwarf::DW_LLE_offset_pair;
232  E.Value0 = Value0;
233  E.Value1 = Value1;
234  E.SectionIndex = SectionIndex;
235  unsigned Bytes = Data.getU16(C);
236  // A single location description describing the location of the object...
237  Data.getU8(C, E.Loc, Bytes);
238  }
239 
240  if (!C)
241  return C.takeError();
242  if (!Callback(E) || E.Kind == dwarf::DW_LLE_end_of_list)
243  break;
244  }
245  *Offset = C.tell();
246  return Error::success();
247 }
248 
250  raw_ostream &OS, unsigned Indent,
251  DIDumpOptions DumpOpts,
252  const DWARFObject &Obj) const {
253  uint64_t Value0, Value1;
254  switch (Entry.Kind) {
255  case dwarf::DW_LLE_base_address:
256  Value0 = Data.getAddressSize() == 4 ? -1U : -1ULL;
257  Value1 = Entry.Value0;
258  break;
259  case dwarf::DW_LLE_offset_pair:
260  Value0 = Entry.Value0;
261  Value1 = Entry.Value1;
262  break;
263  case dwarf::DW_LLE_end_of_list:
264  return;
265  default:
266  llvm_unreachable("Not possible in DWARF4!");
267  }
268  OS << '\n';
269  OS.indent(Indent);
270  OS << '(' << format_hex(Value0, 2 + Data.getAddressSize() * 2) << ", "
271  << format_hex(Value1, 2 + Data.getAddressSize() * 2) << ')';
272  DWARFFormValue::dumpAddressSection(Obj, OS, DumpOpts, Entry.SectionIndex);
273 }
274 
276  uint64_t *Offset, function_ref<bool(const DWARFLocationEntry &)> F) const {
277 
278  DataExtractor::Cursor C(*Offset);
279  bool Continue = true;
280  while (Continue) {
282  E.Kind = Data.getU8(C);
283  switch (E.Kind) {
284  case dwarf::DW_LLE_end_of_list:
285  break;
286  case dwarf::DW_LLE_base_addressx:
287  E.Value0 = Data.getULEB128(C);
288  break;
289  case dwarf::DW_LLE_startx_endx:
290  E.Value0 = Data.getULEB128(C);
291  E.Value1 = Data.getULEB128(C);
292  break;
293  case dwarf::DW_LLE_startx_length:
294  E.Value0 = Data.getULEB128(C);
295  // Pre-DWARF 5 has different interpretation of the length field. We have
296  // to support both pre- and standartized styles for the compatibility.
297  if (Version < 5)
298  E.Value1 = Data.getU32(C);
299  else
300  E.Value1 = Data.getULEB128(C);
301  break;
302  case dwarf::DW_LLE_offset_pair:
303  E.Value0 = Data.getULEB128(C);
304  E.Value1 = Data.getULEB128(C);
305  E.SectionIndex = SectionedAddress::UndefSection;
306  break;
307  case dwarf::DW_LLE_default_location:
308  break;
309  case dwarf::DW_LLE_base_address:
310  E.Value0 = Data.getRelocatedAddress(C, &E.SectionIndex);
311  break;
312  case dwarf::DW_LLE_start_end:
313  E.Value0 = Data.getRelocatedAddress(C, &E.SectionIndex);
314  E.Value1 = Data.getRelocatedAddress(C);
315  break;
316  case dwarf::DW_LLE_start_length:
317  E.Value0 = Data.getRelocatedAddress(C, &E.SectionIndex);
318  E.Value1 = Data.getULEB128(C);
319  break;
320  default:
321  cantFail(C.takeError());
323  "LLE of kind %x not supported", (int)E.Kind);
324  }
325 
326  if (E.Kind != dwarf::DW_LLE_base_address &&
327  E.Kind != dwarf::DW_LLE_base_addressx &&
328  E.Kind != dwarf::DW_LLE_end_of_list) {
329  unsigned Bytes = Version >= 5 ? Data.getULEB128(C) : Data.getU16(C);
330  // A single location description describing the location of the object...
331  Data.getU8(C, E.Loc, Bytes);
332  }
333 
334  if (!C)
335  return C.takeError();
336  Continue = F(E) && E.Kind != dwarf::DW_LLE_end_of_list;
337  }
338  *Offset = C.tell();
339  return Error::success();
340 }
341 
343  raw_ostream &OS, unsigned Indent,
344  DIDumpOptions DumpOpts,
345  const DWARFObject &Obj) const {
346  size_t MaxEncodingStringLength = 0;
347 #define HANDLE_DW_LLE(ID, NAME) \
348  MaxEncodingStringLength = std::max(MaxEncodingStringLength, \
349  dwarf::LocListEncodingString(ID).size());
350 #include "llvm/BinaryFormat/Dwarf.def"
351 
352  OS << "\n";
353  OS.indent(Indent);
354  StringRef EncodingString = dwarf::LocListEncodingString(Entry.Kind);
355  // Unsupported encodings should have been reported during parsing.
356  assert(!EncodingString.empty() && "Unknown loclist entry encoding");
357  OS << format("%-*s(", MaxEncodingStringLength, EncodingString.data());
358  unsigned FieldSize = 2 + 2 * Data.getAddressSize();
359  switch (Entry.Kind) {
360  case dwarf::DW_LLE_end_of_list:
361  case dwarf::DW_LLE_default_location:
362  break;
363  case dwarf::DW_LLE_startx_endx:
364  case dwarf::DW_LLE_startx_length:
365  case dwarf::DW_LLE_offset_pair:
366  case dwarf::DW_LLE_start_end:
367  case dwarf::DW_LLE_start_length:
368  OS << format_hex(Entry.Value0, FieldSize) << ", "
369  << format_hex(Entry.Value1, FieldSize);
370  break;
371  case dwarf::DW_LLE_base_addressx:
372  case dwarf::DW_LLE_base_address:
373  OS << format_hex(Entry.Value0, FieldSize);
374  break;
375  }
376  OS << ')';
377  switch (Entry.Kind) {
378  case dwarf::DW_LLE_base_address:
379  case dwarf::DW_LLE_start_end:
380  case dwarf::DW_LLE_start_length:
381  DWARFFormValue::dumpAddressSection(Obj, OS, DumpOpts, Entry.SectionIndex);
382  break;
383  default:
384  break;
385  }
386 }
387 
389  raw_ostream &OS, const MCRegisterInfo *MRI,
390  const DWARFObject &Obj,
391  DIDumpOptions DumpOpts) {
392  if (!Data.isValidOffsetForDataOfSize(StartOffset, Size)) {
393  OS << "Invalid dump range\n";
394  return;
395  }
396  uint64_t Offset = StartOffset;
397  StringRef Separator;
398  bool CanContinue = true;
399  while (CanContinue && Offset < StartOffset + Size) {
400  OS << Separator;
401  Separator = "\n";
402 
403  CanContinue = dumpLocationList(&Offset, OS, /*BaseAddr=*/std::nullopt, MRI,
404  Obj, nullptr, DumpOpts, /*Indent=*/12);
405  OS << '\n';
406  }
407 }
408 
410  OS << format("unable to resolve indirect address %u for: %s", Index,
411  dwarf::LocListEncodingString(Kind).data());
412 }
413 
DWARFFormValue.h
dumpExpression
static void dumpExpression(raw_ostream &OS, DIDumpOptions DumpOpts, ArrayRef< uint8_t > Data, bool IsLittleEndian, unsigned AddressSize, const MCRegisterInfo *MRI, DWARFUnit *U)
Definition: DWARFDebugLoc.cpp:112
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
StringRef.h
llvm::DWARFFormValue::dumpAddressSection
static void dumpAddressSection(const DWARFObject &Obj, raw_ostream &OS, DIDumpOptions DumpOpts, uint64_t SectionIndex)
Definition: DWARFFormValue.cpp:394
llvm::Error::success
static ErrorSuccess success()
Create a success value.
Definition: Error.h:329
DWARFAddressRange.h
llvm::DWARFLocationExpression
Represents a single DWARF expression, whose value is location-dependent.
Definition: DWARFLocationExpression.h:21
llvm::DWARFExpression::print
void print(raw_ostream &OS, DIDumpOptions DumpOpts, const MCRegisterInfo *RegInfo, DWARFUnit *U, bool IsEH=false) const
Definition: DWARFExpression.cpp:325
llvm::DWARFLocationTable::visitAbsoluteLocationList
Error visitAbsoluteLocationList(uint64_t Offset, std::optional< object::SectionedAddress > BaseAddr, std::function< std::optional< object::SectionedAddress >(uint32_t)> LookupAddr, function_ref< bool(Expected< DWARFLocationExpression >)> Callback) const
Definition: DWARFDebugLoc.cpp:171
llvm::Expected
Tagged union holding either a T or a Error.
Definition: APFloat.h:41
llvm::DWARFDataExtractor
A DataExtractor (typically for an in-memory copy of an object-file section) plus a relocation map for...
Definition: DWARFDataExtractor.h:21
llvm::dwarf::LoclistEntries
LoclistEntries
DWARF v5 loc list entry encoding values.
Definition: Dwarf.h:434
Format.h
llvm::consumeError
void consumeError(Error Err)
Consume a Error without doing anything.
Definition: Error.h:1042
llvm::Data
@ Data
Definition: SIMachineScheduler.h:55
F
#define F(x, y, z)
Definition: MD5.cpp:55
llvm::DWARFDebugLoc::dumpRawEntry
void dumpRawEntry(const DWARFLocationEntry &Entry, raw_ostream &OS, unsigned Indent, DIDumpOptions DumpOpts, const DWARFObject &Obj) const override
Definition: DWARFDebugLoc.cpp:249
llvm::DataExtractor::getULEB128
uint64_t getULEB128(uint64_t *offset_ptr, llvm::Error *Err=nullptr) const
Extract a unsigned LEB128 value from *offset_ptr.
Definition: DataExtractor.cpp:220
llvm::DWARFDataExtractor::getRelocatedAddress
uint64_t getRelocatedAddress(uint64_t *Off, uint64_t *SecIx=nullptr) const
Extracts an address-sized value and applies a relocation to the result if one exists for the given of...
Definition: DWARFDataExtractor.h:72
llvm::DWARFLocationEntry
A single location within a location list.
Definition: DWARFDebugLoc.h:30
E
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
C
(vector float) vec_cmpeq(*A, *B) C
Definition: README_ALTIVEC.txt:86
llvm::DataExtractor::getAddressSize
uint8_t getAddressSize() const
Get the address size for this extractor.
Definition: DataExtractor.h:99
llvm::dwarf::Index
Index
Definition: Dwarf.h:490
DWARFDebugLoc.h
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:53
llvm::DWARFObject
Definition: DWARFObject.h:26
llvm::StringRef::data
const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
Definition: StringRef.h:131
llvm::DWARFAddressRange::SectionIndex
uint64_t SectionIndex
Definition: DWARFAddressRange.h:28
llvm::function_ref
An efficient, type-erasing, non-owning reference to a callable.
Definition: STLFunctionalExtras.h:36
llvm::errc::illegal_byte_sequence
@ illegal_byte_sequence
llvm::StringRef::empty
constexpr bool empty() const
empty - Check if the string is empty.
Definition: StringRef.h:134
llvm::ResolverError::log
void log(raw_ostream &OS) const override
Print an error message to an output stream.
Definition: DWARFDebugLoc.cpp:409
uint64_t
llvm::DataExtractor::isValidOffsetForDataOfSize
bool isValidOffsetForDataOfSize(uint64_t offset, uint64_t length) const
Test the availability of length bytes of data from offset.
Definition: DataExtractor.h:672
move
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
Definition: README.txt:546
llvm::DWARFDebugLoc::dump
void dump(raw_ostream &OS, const MCRegisterInfo *RegInfo, const DWARFObject &Obj, DIDumpOptions DumpOpts, std::optional< uint64_t > Offset) const
Print the location lists found within the debug_loc section.
Definition: DWARFDebugLoc.cpp:186
DWARFUnit.h
llvm::DWARFExpression
Definition: DWARFExpression.h:23
llvm::DWARFUnit::getAddrOffsetSectionItem
std::optional< object::SectionedAddress > getAddrOffsetSectionItem(uint32_t Index) const
Definition: DWARFUnit.cpp:208
llvm::DataExtractor::isValidOffset
bool isValidOffset(uint64_t offset) const
Test the validity of offset.
Definition: DataExtractor.h:665
assert
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::move
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition: STLExtras.h:1861
function
print Print MemDeps of function
Definition: MemDepPrinter.cpp:82
llvm::DataExtractor::Cursor
A class representing a position in a DataExtractor, as well as any error encountered during extractio...
Definition: DataExtractor.h:54
llvm::DataExtractor::getU32
uint32_t getU32(uint64_t *offset_ptr, Error *Err=nullptr) const
Extract a uint32_t value from *offset_ptr.
Definition: DataExtractor.cpp:107
llvm::ArrayRef< uint8_t >
llvm::logicalview::LVAttributeKind::Range
@ Range
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
Dwarf.h
llvm::DWARFLocationTable::visitLocationList
virtual Error visitLocationList(uint64_t *Offset, function_ref< bool(const DWARFLocationEntry &)> Callback) const =0
Call the user-provided callback for each entry (including the end-of-list entry) in the location list...
llvm::DWARFLocationTable::dumpLocationList
bool dumpLocationList(uint64_t *Offset, raw_ostream &OS, std::optional< object::SectionedAddress > BaseAddr, const MCRegisterInfo *MRI, const DWARFObject &Obj, DWARFUnit *U, DIDumpOptions DumpOpts, unsigned Indent) const
Dump the location list at the given Offset.
Definition: DWARFDebugLoc.cpp:124
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:143
if
if(llvm_vc STREQUAL "") set(fake_version_inc "$
Definition: CMakeLists.txt:14
llvm::Expected::get
reference get()
Returns a reference to the stored T value.
Definition: Error.h:566
llvm::cantFail
void cantFail(Error Err, const char *Msg=nullptr)
Report a fatal error if Err is a failure value.
Definition: Error.h:744
uint32_t
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::MCRegisterInfo
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
Definition: MCRegisterInfo.h:135
DWARFLocationExpression.h
llvm::DataExtractor::getU8
uint8_t getU8(uint64_t *offset_ptr, Error *Err=nullptr) const
Extract a uint8_t value from *offset_ptr.
Definition: DataExtractor.cpp:79
MRI
unsigned const MachineRegisterInfo * MRI
Definition: AArch64AdvSIMDScalarPass.cpp:105
DIContext.h
llvm::createStringError
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
Definition: Error.h:1238
std
Definition: BitVector.h:851
llvm::inconvertibleErrorCode
std::error_code inconvertibleErrorCode()
The value returned by this function can be returned from convertToErrorCode for Error values where no...
Definition: Error.cpp:79
llvm::DWARFUnit
Definition: DWARFUnit.h:206
llvm::Error
Lightweight error class with error context and mandatory checking.
Definition: Error.h:155
llvm::DWARFDebugLoc::visitLocationList
Error visitLocationList(uint64_t *Offset, function_ref< bool(const DWARFLocationEntry &)> Callback) const override
Call the user-provided callback for each entry (including the end-of-list entry) in the location list...
Definition: DWARFDebugLoc.cpp:209
llvm::DWARFLocationTable::dumpRawEntry
virtual void dumpRawEntry(const DWARFLocationEntry &Entry, raw_ostream &OS, unsigned Indent, DIDumpOptions DumpOpts, const DWARFObject &Obj) const =0
DWARFExpression.h
llvm::DIDumpOptions::DisplayRawContents
bool DisplayRawContents
Definition: DIContext.h:201
llvm::Expected::takeError
Error takeError()
Take ownership of the stored error.
Definition: Error.h:596
llvm::raw_ostream::indent
raw_ostream & indent(unsigned NumSpaces)
indent - Insert 'NumSpaces' spaces.
Definition: raw_ostream.cpp:494
llvm::DWARFLocationTable::Data
DWARFDataExtractor Data
Definition: DWARFDebugLoc.h:82
llvm::DWARFDebugLoclists::dumpRange
void dumpRange(uint64_t StartOffset, uint64_t Size, raw_ostream &OS, const MCRegisterInfo *MRI, const DWARFObject &Obj, DIDumpOptions DumpOpts)
Dump all location lists within the given range.
Definition: DWARFDebugLoc.cpp:388
llvm::object::SectionedAddress
Definition: ObjectFile.h:144
llvm::DWARFDebugLoclists::visitLocationList
Error visitLocationList(uint64_t *Offset, function_ref< bool(const DWARFLocationEntry &)> Callback) const override
Call the user-provided callback for each entry (including the end-of-list entry) in the location list...
Definition: DWARFDebugLoc.cpp:275
llvm::DWARFDebugLoclists::dumpRawEntry
void dumpRawEntry(const DWARFLocationEntry &Entry, raw_ostream &OS, unsigned Indent, DIDumpOptions DumpOpts, const DWARFObject &Obj) const override
Definition: DWARFDebugLoc.cpp:342
llvm::DWARFAddressRange
Definition: DWARFAddressRange.h:25
raw_ostream.h
llvm::format_hex
FormattedNumber format_hex(uint64_t N, unsigned Width, bool Upper=false)
format_hex - Output N as a fixed width hexadecimal.
Definition: Format.h:186
llvm::ResolverError::ID
static char ID
Definition: DWARFDebugLoc.h:151
llvm::dwarf::LocListEncodingString
StringRef LocListEncodingString(unsigned Encoding)
Definition: Dwarf.cpp:526
llvm::sampleprof::Base
@ Base
Definition: Discriminator.h:58
createResolverError
static Error createResolverError(uint32_t Index, unsigned Kind)
Definition: DWARFDebugLoc.cpp:48
llvm::DataExtractor::getU16
uint16_t getU16(uint64_t *offset_ptr, Error *Err=nullptr) const
Extract a uint16_t value from *offset_ptr.
Definition: DataExtractor.cpp:92
llvm::DIDumpOptions
Container for dump options that control which debug information will be dumped.
Definition: DIContext.h:189
llvm::DIDumpOptions::RecoverableErrorHandler
std::function< void(Error)> RecoverableErrorHandler
Definition: DIContext.h:221