19 for (
const LocationList &L : Locations) {
20 OS <<
format(
"0x%8.8x: ", L.Offset);
21 const unsigned Indent = 12;
22 for (
const Entry &E : L.Entries) {
23 if (&E != L.Entries.begin())
25 OS <<
"Beginning address offset: " <<
format(
"0x%016" PRIx64, E.Begin)
27 OS.
indent(Indent) <<
" Ending address offset: "
28 <<
format(
"0x%016" PRIx64, E.End) <<
'\n';
29 OS.
indent(Indent) <<
" Location description: ";
30 for (
unsigned char Loc : E.Loc) {
31 OS <<
format(
"%2.2x ", Loc);
42 LocationList &Loc = Locations.
back();
51 if (AI != RelocMap.
end())
52 E.Begin += AI->second.second;
54 AI = RelocMap.
find(Offset);
57 if (AI != RelocMap.
end())
58 E.End += AI->second.second;
63 if (E.Begin == 0 && E.End == 0)
66 unsigned Bytes = data.
getU16(&Offset);
70 E.Loc.append(str.
begin(), str.
end());
71 Loc.Entries.push_back(std::move(E));
75 llvm::errs() <<
"error: failed to consume entire .debug_loc section\n";
82 LocationList &Loc = Locations.
back();
85 while ((Kind = static_cast<dwarf::LocationListEntry>(
89 llvm::errs() <<
"error: dumping support for LLE of kind " << (
int)Kind
90 <<
" not implemented\n";
97 E.Length = data.
getU32(&Offset);
99 unsigned Bytes = data.
getU16(&Offset);
103 E.Loc.resize(str.
size());
104 std::copy(str.
begin(), str.
end(), E.Loc.begin());
106 Loc.Entries.push_back(std::move(E));
112 for (
const LocationList &L : Locations) {
113 OS <<
format(
"0x%8.8x: ", L.Offset);
114 const unsigned Indent = 12;
115 for (
const Entry &E : L.Entries) {
116 if (&E != L.Entries.begin())
118 OS <<
"Beginning address index: " << E.Start <<
'\n';
119 OS.
indent(Indent) <<
" Length: " << E.Length <<
'\n';
120 OS.
indent(Indent) <<
" Location description: ";
121 for (
unsigned char Loc : E.Loc)
122 OS <<
format(
"%2.2x ", Loc);
raw_ostream & errs()
This returns a reference to a raw_ostream for standard error.
size_t size() const
size - Get the string size.
void dump(raw_ostream &OS) const
raw_ostream & indent(unsigned NumSpaces)
indent - Insert 'NumSpaces' spaces.
StringRef substr(size_t Start, size_t N=npos) const
Return a reference to the substring from [Start, Start + N).
void parse(DataExtractor data, unsigned AddressSize)
Parse the debug_loc section accessible via the 'data' parameter using the specified address size to i...
void parse(DataExtractor data)
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.
void dump(raw_ostream &OS) const
Print the location lists found within the debug_loc section.
iterator find(const KeyT &Val)
const ARM::ArchExtKind Kind
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.