24 for (
const LocationList &
L : Locations) {
25 OS <<
format(
"0x%8.8x: ",
L.Offset);
26 const unsigned Indent = 12;
27 for (
const Entry &
E :
L.Entries) {
28 if (&E !=
L.Entries.
begin())
30 OS <<
"Beginning address offset: " <<
format(
"0x%016" PRIx64, E.Begin)
32 OS.
indent(Indent) <<
" Ending address offset: "
33 <<
format(
"0x%016" PRIx64, E.End) <<
'\n';
34 OS.
indent(Indent) <<
" Location description: ";
35 for (
unsigned char Loc : E.Loc) {
36 OS <<
format(
"%2.2x ", Loc);
47 LocationList &Loc = Locations.
back();
60 if (E.Begin == 0 && E.End == 0)
63 unsigned Bytes = data.
getU16(&Offset);
67 E.Loc.append(str.
begin(), str.
end());
68 Loc.Entries.push_back(std::move(E));
72 errs() <<
"error: failed to consume entire .debug_loc section\n";
79 LocationList &Loc = Locations.
back();
82 while ((Kind = static_cast<dwarf::LocationListEntry>(
86 errs() <<
"error: dumping support for LLE of kind " << (int)Kind
87 <<
" not implemented\n";
94 E.Length = data.
getU32(&Offset);
96 unsigned Bytes = data.
getU16(&Offset);
100 E.Loc.resize(str.
size());
101 std::copy(str.
begin(), str.
end(), E.Loc.begin());
103 Loc.Entries.push_back(std::move(E));
109 for (
const LocationList &
L : Locations) {
110 OS <<
format(
"0x%8.8x: ",
L.Offset);
111 const unsigned Indent = 12;
112 for (
const Entry &
E :
L.Entries) {
113 if (&E !=
L.Entries.
begin())
115 OS <<
"Beginning address index: " << E.Start <<
'\n';
116 OS.
indent(Indent) <<
" Length: " << E.Length <<
'\n';
117 OS.
indent(Indent) <<
" Location description: ";
118 for (
unsigned char Loc : E.Loc)
119 OS <<
format(
"%2.2x ", Loc);
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
void dump(raw_ostream &OS) const
raw_ostream & indent(unsigned NumSpaces)
indent - Insert 'NumSpaces' spaces.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
void parse(DataExtractor data)
format_object< Ts...> format(const char *Fmt, const Ts &...Vals)
These are helper functions used to produce formatted output.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE StringRef substr(size_t Start, size_t N=npos) const
Return a reference to the substring from [Start, Start + N).
LocationListEntry
Constants for location lists in DWARF v5.
void dump(raw_ostream &OS) const
Print the location lists found within the debug_loc section.
LLVM_ATTRIBUTE_ALWAYS_INLINE size_type size() const
This class implements an extremely fast bulk output stream that can only output to a stream...
StringRef - Represent a constant reference to a string, i.e.
void parse(const DWARFDataExtractor &data)
Parse the debug_loc section accessible via the 'data' parameter using the address size also given in ...