summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2018-09-04 16:21:37 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2018-09-04 16:21:37 +0000
commit881452384a5a017b737a80903bb6295517d7ce20 (patch)
tree3cd8480d6338a680309102e0c97e8405552b4b0d /llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp
parent76c4c3af52178a246626b4857da56b4aeaee68a5 (diff)
downloadbcm5719-llvm-881452384a5a017b737a80903bb6295517d7ce20.tar.gz
bcm5719-llvm-881452384a5a017b737a80903bb6295517d7ce20.zip
[dwarfdump] Improve -diff option by hiding more data.
The -diff option makes it easy to diff dwarf by hiding addresses and offsets. However not all of them were hidden, which should be fixed by this patch. Differential revision: https://reviews.llvm.org/D51593 llvm-svn: 341377
Diffstat (limited to 'llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp')
-rw-r--r--llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp b/llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp
index 1aa43c6b651..27895da8058 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFFormValue.cpp
@@ -387,16 +387,16 @@ void DWARFFormValue::dump(raw_ostream &OS, DIDumpOptions DumpOpts) const {
switch (Form) {
case DW_FORM_exprloc:
case DW_FORM_block:
- OS << format("<0x%" PRIx64 "> ", UValue);
+ AddrOS << format("<0x%" PRIx64 "> ", UValue);
break;
case DW_FORM_block1:
- OS << format("<0x%2.2x> ", (uint8_t)UValue);
+ AddrOS << format("<0x%2.2x> ", (uint8_t)UValue);
break;
case DW_FORM_block2:
- OS << format("<0x%4.4x> ", (uint16_t)UValue);
+ AddrOS << format("<0x%4.4x> ", (uint16_t)UValue);
break;
case DW_FORM_block4:
- OS << format("<0x%8.8x> ", (uint32_t)UValue);
+ AddrOS << format("<0x%8.8x> ", (uint32_t)UValue);
break;
default:
break;
@@ -407,7 +407,7 @@ void DWARFFormValue::dump(raw_ostream &OS, DIDumpOptions DumpOpts) const {
// UValue contains size of block
const uint8_t *EndDataPtr = DataPtr + UValue;
while (DataPtr < EndDataPtr) {
- OS << format("%2.2x ", *DataPtr);
+ AddrOS << format("%2.2x ", *DataPtr);
++DataPtr;
}
} else
@@ -501,8 +501,9 @@ void DWARFFormValue::dump(raw_ostream &OS, DIDumpOptions DumpOpts) const {
if (CURelativeOffset) {
if (DumpOpts.Verbose)
OS << " => {";
- WithColor(OS, HighlightColor::Address).get()
- << format("0x%8.8" PRIx64, UValue + (U ? U->getOffset() : 0));
+ if (DumpOpts.ShowAddresses)
+ WithColor(OS, HighlightColor::Address).get()
+ << format("0x%8.8" PRIx64, UValue + (U ? U->getOffset() : 0));
if (DumpOpts.Verbose)
OS << "}";
}
OpenPOWER on IntegriCloud