From e3397d86649e007926b2057ab22fc052f32b96d0 Mon Sep 17 00:00:00 2001 From: Yuanfang Chen Date: Wed, 19 Jun 2019 18:44:29 +0000 Subject: [PATCH] [llvm-objdump] Remove unnecessary indentation when dumping ELF data. Reviewers: MaskRay, jhenderson, rupprecht Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63393 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363858 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/tools/llvm-objdump/X86/disassemble-code-data-mix.s | 7 +++---- tools/llvm-objdump/llvm-objdump.cpp | 4 +--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/test/tools/llvm-objdump/X86/disassemble-code-data-mix.s b/test/tools/llvm-objdump/X86/disassemble-code-data-mix.s index 8e8822aaa0f..08c61ca51bc 100644 --- a/test/tools/llvm-objdump/X86/disassemble-code-data-mix.s +++ b/test/tools/llvm-objdump/X86/disassemble-code-data-mix.s @@ -1,4 +1,4 @@ -// RUN: llvm-mc %s -filetype=obj -triple=x86_64-pc-linux | llvm-objdump -d - | FileCheck %s +// RUN: llvm-mc %s -filetype=obj -triple=x86_64-pc-linux | llvm-objdump -d - | FileCheck --strict-whitespace --match-full-lines %s .text .globl foo .type foo, @function @@ -14,6 +14,5 @@ foo: bar: .string "test string" -// CHECK: b: 74 65 73 74 20 73 74 72 test str -// CHECK-NEXT: 13: 69 6e 67 00 ing. - +// CHECK: b: 74 65 73 74 20 73 74 72 test str +// CHECK-NEXT: 13: 69 6e 67 00 ing. diff --git a/tools/llvm-objdump/llvm-objdump.cpp b/tools/llvm-objdump/llvm-objdump.cpp index fcb419d05c8..22167f15e14 100644 --- a/tools/llvm-objdump/llvm-objdump.cpp +++ b/tools/llvm-objdump/llvm-objdump.cpp @@ -996,10 +996,8 @@ static void dumpELFData(uint64_t SectionAddr, uint64_t Index, uint64_t End, int NumBytes = 0; for (; Index < End; ++Index) { - if (NumBytes == 0) { + if (NumBytes == 0) outs() << format("%8" PRIx64 ":", SectionAddr + Index); - outs() << "\t"; - } Byte = Bytes.slice(Index)[0]; outs() << format(" %02x", Byte); AsciiData[NumBytes] = isPrint(Byte) ? Byte : '.'; -- 2.50.1