]> granicus.if.org Git - llvm/commit
[llvm-objdump] Align instructions to a tab stop in disassembly output
authorFangrui Song <maskray@google.com>
Tue, 16 Apr 2019 03:56:55 +0000 (03:56 +0000)
committerFangrui Song <maskray@google.com>
Tue, 16 Apr 2019 03:56:55 +0000 (03:56 +0000)
commit078c887eb004efde12502b11c36679e53997a780
treee91f0915eb429064389329db7ebb0a72d7119fa6
parent1e6eb4cd5098297e4776605183e1147e9b3cfb7e
[llvm-objdump] Align instructions to a tab stop in disassembly output

This relands D60376/rL358405, with the difference: sed 'y/\t/ /' -> tr '\t' ' '
BSD sed doesn't support escape characters for the 'y' command.
I didn't use it in rL358405 because it was not listed at
https://llvm.org/docs/GettingStarted.html#software but it
should be available.

Original description:

In GNU objdump, -w/--wide aligns instructions in the disassembly output.
This patch does the same to llvm-objdump. However, we always use the
wide format (-w/--wide is ignored), because the narrow format
(instructions are misaligned) is probably not very useful.

In llvm-readobj, we made a similar decision: always use the wide format,
accept but ignore -W/--wide.

To save some columns, we change the tab before hex bytes (controlled by
--[no-]show-raw-insn) to a space.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358474 91177308-0d34-0410-b5e6-96231b3b80d8
test/tools/llvm-objdump/X86/disassemble-align.s [new file with mode: 0644]
tools/llvm-objdump/llvm-objdump.cpp