18 for (
const LocationList &
L : Locations) {
19 OS <<
format(
"0x%8.8x: ",
L.Offset);
20 const unsigned Indent = 12;
21 for (
const Entry &
E :
L.Entries) {
22 if (&E !=
L.Entries.
begin())
24 OS <<
"Beginning address offset: " <<
format(
"0x%016" PRIx64, E.Begin)
26 OS.
indent(Indent) <<
" Ending address offset: "
27 <<
format(
"0x%016" PRIx64, E.End) <<
'\n';
28 OS.
indent(Indent) <<
" Location description: ";
29 for (
unsigned char Loc : E.Loc) {
30 OS <<
format(
"%2.2x ", Loc);
41 LocationList &Loc = Locations.
back();
50 if (AI != RelocMap.
end())
51 E.Begin += AI->second.second;
53 AI = RelocMap.
find(Offset);
56 if (AI != RelocMap.
end())
57 E.End += AI->second.second;
62 if (E.Begin == 0 && E.End == 0)
65 unsigned Bytes = data.
getU16(&Offset);
69 E.Loc.append(str.
begin(), str.
end());
70 Loc.Entries.push_back(std::move(E));
74 llvm::errs() <<
"error: failed to consume entire .debug_loc section\n";
81 LocationList &Loc = Locations.
back();
84 while ((Kind = static_cast<dwarf::LocationListEntry>(
88 llvm::errs() <<
"error: dumping support for LLE of kind " << (int)Kind
89 <<
" not implemented\n";
96 E.Length = data.
getU32(&Offset);
98 unsigned Bytes = data.
getU16(&Offset);
102 E.Loc.resize(str.
size());
103 std::copy(str.
begin(), str.
end(), E.Loc.begin());
105 Loc.Entries.push_back(std::move(E));
111 for (
const LocationList &
L : Locations) {
112 OS <<
format(
"0x%8.8x: ",
L.Offset);
113 const unsigned Indent = 12;
114 for (
const Entry &
E :
L.Entries) {
115 if (&E !=
L.Entries.
begin())
117 OS <<
"Beginning address index: " << E.Start <<
'\n';
118 OS.
indent(Indent) <<
" Length: " << E.Length <<
'\n';
119 OS.
indent(Indent) <<
" Location description: ";
120 for (
unsigned char Loc : E.Loc)
121 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.
void parse(DataExtractor data, unsigned AddressSize)
Parse the debug_loc section accessible via the 'data' parameter using the specified address size to i...
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size() const
size - Get the string size.
void parse(DataExtractor data)
static GCRegistry::Add< CoreCLRGC > E("coreclr","CoreCLR-compatible GC")
format_object< Ts...> format(const char *Fmt, const Ts &...Vals)
These are helper functions used to produce formatted output.
* if(!EatIfPresent(lltok::kw_thread_local)) return false
ParseOptionalThreadLocal := /*empty.
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
iterator find(const KeyT &Val)
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.