X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=blobdiff_plain;f=lib%2FDebugInfo%2FDWARFDebugInfoEntry.cpp;h=583e70055c0104e7b9970f6f42f03d8a43ba6fc3;hp=15c04cb949bb662a69c37aa5bb0a5d60f2e1bae1;hb=9970b0fcaa2f74ec9aa4440205dfcc5121110d6c;hpb=bdc3a5b99af0dfbf2b0c4b1d59cd50f247b06522 diff --git a/lib/DebugInfo/DWARFDebugInfoEntry.cpp b/lib/DebugInfo/DWARFDebugInfoEntry.cpp index 15c04cb949b..583e70055c0 100644 --- a/lib/DebugInfo/DWARFDebugInfoEntry.cpp +++ b/lib/DebugInfo/DWARFDebugInfoEntry.cpp @@ -88,12 +88,27 @@ static void dumpApplePropertyAttribute(raw_ostream &OS, uint64_t Val) { OS << ")"; } +static void dumpRanges(raw_ostream &OS, const DWARFAddressRangesVector& Ranges, + unsigned AddressSize, unsigned Indent) { + if (Ranges.empty()) + return; + + for (const auto &Range: Ranges) { + OS << '\n'; + OS.indent(Indent); + OS << format("[0x%0*" PRIx64 " - 0x%0*" PRIx64 ")", + AddressSize*2, Range.first, + AddressSize*2, Range.second); + } +} + void DWARFDebugInfoEntryMinimal::dumpAttribute(raw_ostream &OS, DWARFUnit *u, uint32_t *offset_ptr, uint16_t attr, uint16_t form, unsigned indent) const { - OS << " "; + const char BaseIndent[] = " "; + OS << BaseIndent; OS.indent(indent+2); const char *attrString = AttributeString(attr); if (attrString) @@ -149,6 +164,9 @@ void DWARFDebugInfoEntryMinimal::dumpAttribute(raw_ostream &OS, } else if (attr == DW_AT_APPLE_property_attribute) { if (Optional OptVal = formValue.getAsUnsignedConstant()) dumpApplePropertyAttribute(OS, *OptVal); + } else if (attr == DW_AT_ranges) { + dumpRanges(OS, getAddressRanges(u), u->getAddressByteSize(), + sizeof(BaseIndent)+indent+4); } OS << ")\n";