summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2018-03-07 16:28:53 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2018-03-07 16:28:53 +0000
commitbf8596f9cf5e22292e4544f9d40e6cd12a3b4beb (patch)
tree517f9e0faaf056370dfa9e1a1175c4233bc14f90 /llvm/lib/DebugInfo
parente12a48bcc089b9942fa405076ccabac73fae3e86 (diff)
downloadbcm5719-llvm-bf8596f9cf5e22292e4544f9d40e6cd12a3b4beb.tar.gz
bcm5719-llvm-bf8596f9cf5e22292e4544f9d40e6cd12a3b4beb.zip
[dwarfdump] Only print CU relative offset in verbose mode
Instead of only printing the CU-relative offset in non-verbose mode, it makes more sense to only printed the resolved address. In verbose mode we still print both. Differential revision: https://reviews.llvm.org/D44148 rdar://33525475 llvm-svn: 326903
Diffstat (limited to 'llvm/lib/DebugInfo')
-rw-r--r--llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp b/llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp
index 1f00decfc11..5ccd42925cd 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp
@@ -538,23 +538,28 @@ void DWARFFormValue::dump(raw_ostream &OS, DIDumpOptions DumpOpts) const {
break;
case DW_FORM_ref1:
CURelativeOffset = true;
- AddrOS << format("cu + 0x%2.2x", (uint8_t)UValue);
+ if (DumpOpts.Verbose)
+ AddrOS << format("cu + 0x%2.2x", (uint8_t)UValue);
break;
case DW_FORM_ref2:
CURelativeOffset = true;
- AddrOS << format("cu + 0x%4.4x", (uint16_t)UValue);
+ if (DumpOpts.Verbose)
+ AddrOS << format("cu + 0x%4.4x", (uint16_t)UValue);
break;
case DW_FORM_ref4:
CURelativeOffset = true;
- AddrOS << format("cu + 0x%4.4x", (uint32_t)UValue);
+ if (DumpOpts.Verbose)
+ AddrOS << format("cu + 0x%4.4x", (uint32_t)UValue);
break;
case DW_FORM_ref8:
CURelativeOffset = true;
- AddrOS << format("cu + 0x%8.8" PRIx64, UValue);
+ if (DumpOpts.Verbose)
+ AddrOS << format("cu + 0x%8.8" PRIx64, UValue);
break;
case DW_FORM_ref_udata:
CURelativeOffset = true;
- AddrOS << format("cu + 0x%" PRIx64, UValue);
+ if (DumpOpts.Verbose)
+ AddrOS << format("cu + 0x%" PRIx64, UValue);
break;
case DW_FORM_GNU_ref_alt:
AddrOS << format("<alt 0x%" PRIx64 ">", UValue);
@@ -576,11 +581,13 @@ void DWARFFormValue::dump(raw_ostream &OS, DIDumpOptions DumpOpts) const {
break;
}
- if (CURelativeOffset && DumpOpts.Verbose) {
- OS << " => {";
+ if (CURelativeOffset) {
+ if (DumpOpts.Verbose)
+ OS << " => {";
WithColor(OS, syntax::Address).get()
<< format("0x%8.8" PRIx64, UValue + (U ? U->getOffset() : 0));
- OS << "}";
+ if (DumpOpts.Verbose)
+ OS << "}";
}
}
OpenPOWER on IntegriCloud