LLVM  14.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"
16 #include "llvm/Support/Compiler.h"
17 #include "llvm/Support/Format.h"
18 #include "llvm/Support/WithColor.h"
20 #include <algorithm>
21 #include <cinttypes>
22 #include <cstdint>
23 
24 using namespace llvm;
26 
27 namespace {
28 class DWARFLocationInterpreter {
30  std::function<Optional<object::SectionedAddress>(uint32_t)> LookupAddr;
31 
32 public:
33  DWARFLocationInterpreter(
36  : Base(Base), LookupAddr(std::move(LookupAddr)) {}
37 
39  Interpret(const DWARFLocationEntry &E);
40 };
41 } // namespace
42 
44  return make_error<ResolverError>(Index, (dwarf::LoclistEntries)Kind);
45 }
46 
48 DWARFLocationInterpreter::Interpret(const DWARFLocationEntry &E) {
49  switch (E.Kind) {
50  case dwarf::DW_LLE_end_of_list:
51  return None;
52  case dwarf::DW_LLE_base_addressx: {
53  Base = LookupAddr(E.Value0);
54  if (!Base)
55  return createResolverError(E.Value0, E.Kind);
56  return None;
57  }
58  case dwarf::DW_LLE_startx_endx: {
59  Optional<SectionedAddress> LowPC = LookupAddr(E.Value0);
60  if (!LowPC)
61  return createResolverError(E.Value0, E.Kind);
62  Optional<SectionedAddress> HighPC = LookupAddr(E.Value1);
63  if (!HighPC)
64  return createResolverError(E.Value1, E.Kind);
66  DWARFAddressRange{LowPC->Address, HighPC->Address, LowPC->SectionIndex},
67  E.Loc};
68  }
69  case dwarf::DW_LLE_startx_length: {
70  Optional<SectionedAddress> LowPC = LookupAddr(E.Value0);
71  if (!LowPC)
72  return createResolverError(E.Value0, E.Kind);
74  LowPC->Address + E.Value1,
75  LowPC->SectionIndex},
76  E.Loc};
77  }
78  case dwarf::DW_LLE_offset_pair: {
79  if (!Base) {
81  "Unable to resolve location list offset pair: "
82  "Base address not defined");
83  }
84  DWARFAddressRange Range{Base->Address + E.Value0, Base->Address + E.Value1,
85  Base->SectionIndex};
86  if (Range.SectionIndex == SectionedAddress::UndefSection)
87  Range.SectionIndex = E.SectionIndex;
88  return DWARFLocationExpression{Range, E.Loc};
89  }
90  case dwarf::DW_LLE_default_location:
91  return DWARFLocationExpression{None, E.Loc};
92  case dwarf::DW_LLE_base_address:
93  Base = SectionedAddress{E.Value0, E.SectionIndex};
94  return None;
95  case dwarf::DW_LLE_start_end:
97  DWARFAddressRange{E.Value0, E.Value1, E.SectionIndex}, E.Loc};
98  case dwarf::DW_LLE_start_length:
100  DWARFAddressRange{E.Value0, E.Value0 + E.Value1, E.SectionIndex},
101  E.Loc};
102  default:
103  llvm_unreachable("unreachable locations list kind");
104  }
105 }
106 
107 static void dumpExpression(raw_ostream &OS, DIDumpOptions DumpOpts,
108  ArrayRef<uint8_t> Data, bool IsLittleEndian,
109  unsigned AddressSize, const MCRegisterInfo *MRI,
110  DWARFUnit *U) {
111  DWARFDataExtractor Extractor(Data, IsLittleEndian, AddressSize);
112  // Note. We do not pass any format to DWARFExpression, even if the
113  // corresponding unit is known. For now, there is only one operation,
114  // DW_OP_call_ref, which depends on the format; it is rarely used, and
115  // is unexpected in location tables.
116  DWARFExpression(Extractor, AddressSize).print(OS, DumpOpts, MRI, U);
117 }
118 
121  const MCRegisterInfo *MRI,
122  const DWARFObject &Obj, DWARFUnit *U,
123  DIDumpOptions DumpOpts,
124  unsigned Indent) const {
125  DWARFLocationInterpreter Interp(
126  BaseAddr, [U](uint32_t Index) -> Optional<SectionedAddress> {
127  if (U)
128  return U->getAddrOffsetSectionItem(Index);
129  return None;
130  });
131  OS << format("0x%8.8" PRIx64 ": ", *Offset);
133  Expected<Optional<DWARFLocationExpression>> Loc = Interp.Interpret(E);
134  if (!Loc || DumpOpts.DisplayRawContents)
135  dumpRawEntry(E, OS, Indent, DumpOpts, Obj);
136  if (Loc && *Loc) {
137  OS << "\n";
138  OS.indent(Indent);
139  if (DumpOpts.DisplayRawContents)
140  OS << " => ";
141 
142  DIDumpOptions RangeDumpOpts(DumpOpts);
143  RangeDumpOpts.DisplayRawContents = false;
144  if (Loc.get()->Range)
145  Loc.get()->Range->dump(OS, Data.getAddressSize(), RangeDumpOpts, &Obj);
146  else
147  OS << "<default>";
148  }
149  if (!Loc)
150  consumeError(Loc.takeError());
151 
152  if (E.Kind != dwarf::DW_LLE_base_address &&
153  E.Kind != dwarf::DW_LLE_base_addressx &&
154  E.Kind != dwarf::DW_LLE_end_of_list) {
155  OS << ": ";
156  dumpExpression(OS, DumpOpts, E.Loc, Data.isLittleEndian(),
157  Data.getAddressSize(), MRI, U);
158  }
159  return true;
160  });
161  if (E) {
163  return false;
164  }
165  return true;
166 }
167 
171  function_ref<bool(Expected<DWARFLocationExpression>)> Callback) const {
172  DWARFLocationInterpreter Interp(BaseAddr, std::move(LookupAddr));
173  return visitLocationList(&Offset, [&](const DWARFLocationEntry &E) {
174  Expected<Optional<DWARFLocationExpression>> Loc = Interp.Interpret(E);
175  if (!Loc)
176  return Callback(Loc.takeError());
177  if (*Loc)
178  return Callback(**Loc);
179  return true;
180  });
181 }
182 
184  const DWARFObject &Obj, DIDumpOptions DumpOpts,
185  Optional<uint64_t> DumpOffset) const {
186  auto BaseAddr = None;
187  unsigned Indent = 12;
188  if (DumpOffset) {
189  dumpLocationList(&*DumpOffset, OS, BaseAddr, MRI, Obj, nullptr, DumpOpts,
190  Indent);
191  } else {
192  uint64_t Offset = 0;
193  StringRef Separator;
194  bool CanContinue = true;
195  while (CanContinue && Data.isValidOffset(Offset)) {
196  OS << Separator;
197  Separator = "\n";
198 
199  CanContinue = dumpLocationList(&Offset, OS, BaseAddr, MRI, Obj, nullptr,
200  DumpOpts, Indent);
201  OS << '\n';
202  }
203  }
204 }
205 
207  uint64_t *Offset,
208  function_ref<bool(const DWARFLocationEntry &)> Callback) const {
210  while (true) {
211  uint64_t SectionIndex;
213  uint64_t Value1 = Data.getRelocatedAddress(C, &SectionIndex);
214 
216 
217  // The end of any given location list is marked by an end of list entry,
218  // which consists of a 0 for the beginning address offset and a 0 for the
219  // ending address offset. A beginning offset of 0xff...f marks the base
220  // address selection entry.
221  if (Value0 == 0 && Value1 == 0) {
222  E.Kind = dwarf::DW_LLE_end_of_list;
223  } else if (Value0 == (Data.getAddressSize() == 4 ? -1U : -1ULL)) {
224  E.Kind = dwarf::DW_LLE_base_address;
225  E.Value0 = Value1;
226  E.SectionIndex = SectionIndex;
227  } else {
228  E.Kind = dwarf::DW_LLE_offset_pair;
229  E.Value0 = Value0;
230  E.Value1 = Value1;
231  E.SectionIndex = SectionIndex;
232  unsigned Bytes = Data.getU16(C);
233  // A single location description describing the location of the object...
234  Data.getU8(C, E.Loc, Bytes);
235  }
236 
237  if (!C)
238  return C.takeError();
239  if (!Callback(E) || E.Kind == dwarf::DW_LLE_end_of_list)
240  break;
241  }
242  *Offset = C.tell();
243  return Error::success();
244 }
245 
247  raw_ostream &OS, unsigned Indent,
248  DIDumpOptions DumpOpts,
249  const DWARFObject &Obj) const {
250  uint64_t Value0, Value1;
251  switch (Entry.Kind) {
252  case dwarf::DW_LLE_base_address:
253  Value0 = Data.getAddressSize() == 4 ? -1U : -1ULL;
254  Value1 = Entry.Value0;
255  break;
256  case dwarf::DW_LLE_offset_pair:
257  Value0 = Entry.Value0;
258  Value1 = Entry.Value1;
259  break;
260  case dwarf::DW_LLE_end_of_list:
261  return;
262  default:
263  llvm_unreachable("Not possible in DWARF4!");
264  }
265  OS << '\n';
266  OS.indent(Indent);
267  OS << '(' << format_hex(Value0, 2 + Data.getAddressSize() * 2) << ", "
268  << format_hex(Value1, 2 + Data.getAddressSize() * 2) << ')';
269  DWARFFormValue::dumpAddressSection(Obj, OS, DumpOpts, Entry.SectionIndex);
270 }
271 
273  uint64_t *Offset, function_ref<bool(const DWARFLocationEntry &)> F) const {
274 
276  bool Continue = true;
277  while (Continue) {
279  E.Kind = Data.getU8(C);
280  switch (E.Kind) {
281  case dwarf::DW_LLE_end_of_list:
282  break;
283  case dwarf::DW_LLE_base_addressx:
284  E.Value0 = Data.getULEB128(C);
285  break;
286  case dwarf::DW_LLE_startx_endx:
287  E.Value0 = Data.getULEB128(C);
288  E.Value1 = Data.getULEB128(C);
289  break;
290  case dwarf::DW_LLE_startx_length:
291  E.Value0 = Data.getULEB128(C);
292  // Pre-DWARF 5 has different interpretation of the length field. We have
293  // to support both pre- and standartized styles for the compatibility.
294  if (Version < 5)
295  E.Value1 = Data.getU32(C);
296  else
297  E.Value1 = Data.getULEB128(C);
298  break;
299  case dwarf::DW_LLE_offset_pair:
300  E.Value0 = Data.getULEB128(C);
301  E.Value1 = Data.getULEB128(C);
302  E.SectionIndex = SectionedAddress::UndefSection;
303  break;
304  case dwarf::DW_LLE_default_location:
305  break;
306  case dwarf::DW_LLE_base_address:
307  E.Value0 = Data.getRelocatedAddress(C, &E.SectionIndex);
308  break;
309  case dwarf::DW_LLE_start_end:
310  E.Value0 = Data.getRelocatedAddress(C, &E.SectionIndex);
311  E.Value1 = Data.getRelocatedAddress(C);
312  break;
313  case dwarf::DW_LLE_start_length:
314  E.Value0 = Data.getRelocatedAddress(C, &E.SectionIndex);
315  E.Value1 = Data.getULEB128(C);
316  break;
317  default:
318  cantFail(C.takeError());
320  "LLE of kind %x not supported", (int)E.Kind);
321  }
322 
323  if (E.Kind != dwarf::DW_LLE_base_address &&
324  E.Kind != dwarf::DW_LLE_base_addressx &&
325  E.Kind != dwarf::DW_LLE_end_of_list) {
326  unsigned Bytes = Version >= 5 ? Data.getULEB128(C) : Data.getU16(C);
327  // A single location description describing the location of the object...
328  Data.getU8(C, E.Loc, Bytes);
329  }
330 
331  if (!C)
332  return C.takeError();
333  Continue = F(E) && E.Kind != dwarf::DW_LLE_end_of_list;
334  }
335  *Offset = C.tell();
336  return Error::success();
337 }
338 
340  raw_ostream &OS, unsigned Indent,
341  DIDumpOptions DumpOpts,
342  const DWARFObject &Obj) const {
343  size_t MaxEncodingStringLength = 0;
344 #define HANDLE_DW_LLE(ID, NAME) \
345  MaxEncodingStringLength = std::max(MaxEncodingStringLength, \
346  dwarf::LocListEncodingString(ID).size());
347 #include "llvm/BinaryFormat/Dwarf.def"
348 
349  OS << "\n";
350  OS.indent(Indent);
351  StringRef EncodingString = dwarf::LocListEncodingString(Entry.Kind);
352  // Unsupported encodings should have been reported during parsing.
353  assert(!EncodingString.empty() && "Unknown loclist entry encoding");
354  OS << format("%-*s(", MaxEncodingStringLength, EncodingString.data());
355  unsigned FieldSize = 2 + 2 * Data.getAddressSize();
356  switch (Entry.Kind) {
357  case dwarf::DW_LLE_end_of_list:
358  case dwarf::DW_LLE_default_location:
359  break;
360  case dwarf::DW_LLE_startx_endx:
361  case dwarf::DW_LLE_startx_length:
362  case dwarf::DW_LLE_offset_pair:
363  case dwarf::DW_LLE_start_end:
364  case dwarf::DW_LLE_start_length:
365  OS << format_hex(Entry.Value0, FieldSize) << ", "
366  << format_hex(Entry.Value1, FieldSize);
367  break;
368  case dwarf::DW_LLE_base_addressx:
369  case dwarf::DW_LLE_base_address:
370  OS << format_hex(Entry.Value0, FieldSize);
371  break;
372  }
373  OS << ')';
374  switch (Entry.Kind) {
375  case dwarf::DW_LLE_base_address:
376  case dwarf::DW_LLE_start_end:
377  case dwarf::DW_LLE_start_length:
378  DWARFFormValue::dumpAddressSection(Obj, OS, DumpOpts, Entry.SectionIndex);
379  break;
380  default:
381  break;
382  }
383 }
384 
386  raw_ostream &OS, const MCRegisterInfo *MRI,
387  const DWARFObject &Obj,
388  DIDumpOptions DumpOpts) {
389  if (!Data.isValidOffsetForDataOfSize(StartOffset, Size)) {
390  OS << "Invalid dump range\n";
391  return;
392  }
393  uint64_t Offset = StartOffset;
394  StringRef Separator;
395  bool CanContinue = true;
396  while (CanContinue && Offset < StartOffset + Size) {
397  OS << Separator;
398  Separator = "\n";
399 
400  CanContinue = dumpLocationList(&Offset, OS, /*BaseAddr=*/None, MRI, Obj,
401  nullptr, DumpOpts, /*Indent=*/12);
402  OS << '\n';
403  }
404 }
405 
407  OS << format("unable to resolve indirect address %u for: %s", Index,
408  dwarf::LocListEncodingString(Kind).data());
409 }
410 
llvm::Check::Size
@ Size
Definition: FileCheck.h:73
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:107
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:22
StringRef.h
llvm::DWARFFormValue::dumpAddressSection
static void dumpAddressSection(const DWARFObject &Obj, raw_ostream &OS, DIDumpOptions DumpOpts, uint64_t SectionIndex)
Definition: DWARFFormValue.cpp:390
llvm::object::SectionedAddress::Address
uint64_t Address
Definition: ObjectFile.h:146
llvm::Error::success
static ErrorSuccess success()
Create a success value.
Definition: Error.h:329
DWARFContext.h
DWARFRelocMap.h
llvm::DWARFLocationExpression
Represents a single DWARF expression, whose value is location-dependent.
Definition: DWARFLocationExpression.h:22
llvm::Optional
Definition: APInt.h:33
Offset
uint64_t Offset
Definition: ELFObjHandler.cpp:80
llvm::DWARFExpression::print
void print(raw_ostream &OS, DIDumpOptions DumpOpts, const MCRegisterInfo *RegInfo, DWARFUnit *U, bool IsEH=false) const
Definition: DWARFExpression.cpp:325
llvm::Expected
Tagged union holding either a T or a Error.
Definition: APFloat.h:42
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:411
Format.h
llvm::consumeError
void consumeError(Error Err)
Consume a Error without doing anything.
Definition: Error.h:1043
llvm::Data
@ Data
Definition: SIMachineScheduler.h:55
llvm::object::SectionedAddress::SectionIndex
uint64_t SectionIndex
Definition: ObjectFile.h:147
llvm::DWARFUnit::getAddrOffsetSectionItem
Optional< object::SectionedAddress > getAddrOffsetSectionItem(uint32_t Index) const
Definition: DWARFUnit.cpp:194
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:246
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:28
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::DWARFLocationTable::dumpLocationList
bool dumpLocationList(uint64_t *Offset, raw_ostream &OS, 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:119
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:54
llvm::DWARFObject
Definition: DWARFObject.h:25
llvm::None
const NoneType None
Definition: None.h:23
llvm::lltok::Kind
Kind
Definition: LLToken.h:18
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::ResolverError::log
void log(raw_ostream &OS) const override
Print an error message to an output stream.
Definition: DWARFDebugLoc.cpp:406
llvm::StringRef::empty
constexpr LLVM_NODISCARD bool empty() const
empty - Check if the string is empty.
Definition: StringRef.h:153
Index
uint32_t Index
Definition: ELFObjHandler.cpp:83
llvm::DWARFLocationTable::visitAbsoluteLocationList
Error visitAbsoluteLocationList(uint64_t Offset, Optional< object::SectionedAddress > BaseAddr, std::function< Optional< object::SectionedAddress >(uint32_t)> LookupAddr, function_ref< bool(Expected< DWARFLocationExpression >)> Callback) const
Definition: DWARFDebugLoc.cpp:168
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
DWARFUnit.h
llvm::DWARFExpression
Definition: DWARFExpression.h:25
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:1650
function
print Print MemDeps of function
Definition: MemDepPrinter.cpp:83
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::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
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_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition: ErrorHandling.h:134
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:567
llvm::cantFail
void cantFail(Error Err, const char *Msg=nullptr)
Report a fatal error if Err is a failure value.
Definition: Error.h:745
uint32_t
Compiler.h
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
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
llvm::DWARFDebugLoc::dump
void dump(raw_ostream &OS, const MCRegisterInfo *RegInfo, const DWARFObject &Obj, DIDumpOptions DumpOpts, Optional< uint64_t > Offset) const
Print the location lists found within the debug_loc section.
Definition: DWARFDebugLoc.cpp:183
MRI
unsigned const MachineRegisterInfo * MRI
Definition: AArch64AdvSIMDScalarPass.cpp:105
WithColor.h
llvm::createStringError
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
Definition: Error.h:1239
std
Definition: BitVector.h:850
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:77
llvm::DWARFUnit
Definition: DWARFUnit.h:203
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:206
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:192
llvm::Expected::takeError
Error takeError()
Take ownership of the stored error.
Definition: Error.h:597
llvm::raw_ostream::indent
raw_ostream & indent(unsigned NumSpaces)
indent - Insert 'NumSpaces' spaces.
Definition: raw_ostream.cpp:496
llvm::DWARFLocationTable::Data
DWARFDataExtractor Data
Definition: DWARFDebugLoc.h:79
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:385
llvm::object::SectionedAddress
Definition: ObjectFile.h:143
llvm::StringRef::data
const LLVM_NODISCARD char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
Definition: StringRef.h:149
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:272
llvm::DWARFDebugLoclists::dumpRawEntry
void dumpRawEntry(const DWARFLocationEntry &Entry, raw_ostream &OS, unsigned Indent, DIDumpOptions DumpOpts, const DWARFObject &Obj) const override
Definition: DWARFDebugLoc.cpp:339
llvm::DWARFAddressRange
Definition: DWARFAddressRange.h:22
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:148
llvm::dwarf::LocListEncodingString
StringRef LocListEncodingString(unsigned Encoding)
Definition: Dwarf.cpp:525
llvm::sampleprof::Base
@ Base
Definition: Discriminator.h:58
createResolverError
static Error createResolverError(uint32_t Index, unsigned Kind)
Definition: DWARFDebugLoc.cpp:43
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:180
llvm::DIDumpOptions::RecoverableErrorHandler
std::function< void(Error)> RecoverableErrorHandler
Definition: DIContext.h:212