summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorFrederic Riss <friss@apple.com>2014-10-23 04:08:34 +0000
committerFrederic Riss <friss@apple.com>2014-10-23 04:08:34 +0000
commite939b43aa427f392b8bfbe1654dd547efcfa90ba (patch)
tree5a0d34bc5a4195f5e0f8d67ff6cd914789a679aa /llvm/lib
parent3d541d12ed64777e8a395c79e19ebdd467ca022e (diff)
downloadbcm5719-llvm-e939b43aa427f392b8bfbe1654dd547efcfa90ba.tar.gz
bcm5719-llvm-e939b43aa427f392b8bfbe1654dd547efcfa90ba.zip
[dwarfdump] Dump DW_AT_ranges values inline in the debug_info dump.
The output looks like that: DW_AT_ranges [FORM_data4] (0x00000000 [0x00000001000024a0 - 0x00000001000024c2) [0x0000000100002505 - 0x000000010000268b)) Differential Revision: http://reviews.llvm.org/D5712 llvm-svn: 220466
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp b/llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp
index 15c04cb949b..583e70055c0 100644
--- a/llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp
+++ b/llvm/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<uint64_t> OptVal = formValue.getAsUnsignedConstant())
dumpApplePropertyAttribute(OS, *OptVal);
+ } else if (attr == DW_AT_ranges) {
+ dumpRanges(OS, getAddressRanges(u), u->getAddressByteSize(),
+ sizeof(BaseIndent)+indent+4);
}
OS << ")\n";
OpenPOWER on IntegriCloud