[all-commits] [llvm/llvm-project] abe0fa: [llvm-objdump] Print comments for the disassembled...

Igor Kudrin via All-commits all-commits at lists.llvm.org
Mon Jun 28 00:27:22 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: abe0fa43523502c549ff9394d28f9f29f5be0a3d
      https://github.com/llvm/llvm-project/commit/abe0fa43523502c549ff9394d28f9f29f5be0a3d
  Author: Igor Kudrin <ikudrin at accesssoftek.com>
  Date:   2021-06-28 (Mon, 28 Jun 2021)

  Changed paths:
    M llvm/test/tools/llvm-objdump/ELF/AArch64/disassemble-align.s
    A llvm/test/tools/llvm-objdump/ELF/AArch64/disassemble-print-comments.s
    M llvm/test/tools/llvm-objdump/X86/disassemble-align.s
    A llvm/test/tools/llvm-objdump/X86/disassemble-print-comments.s
    M llvm/tools/llvm-objdump/llvm-objdump.cpp

  Log Message:
  -----------
  [llvm-objdump] Print comments for the disassembled code

LLVM disassembler can generate comments for disassembled instructions.
The patch enables printing these comments for 'llvm-objdump -d'.

Differential Revision: https://reviews.llvm.org/D104699


  Commit: c2e6bcb494c12b138283272e2e0932e13627898e
      https://github.com/llvm/llvm-project/commit/c2e6bcb494c12b138283272e2e0932e13627898e
  Author: Igor Kudrin <ikudrin at accesssoftek.com>
  Date:   2021-06-28 (Mon, 28 Jun 2021)

  Changed paths:
    M llvm/docs/CommandGuide/llvm-objdump.rst
    M llvm/test/tools/llvm-objdump/ELF/AArch64/disassemble-print-comments.s
    M llvm/test/tools/llvm-objdump/ELF/ARM/debug-vars-dwarf4.s
    M llvm/test/tools/llvm-objdump/ELF/ARM/debug-vars-wide-chars.s
    M llvm/test/tools/llvm-objdump/X86/disassemble-print-comments.s
    M llvm/tools/llvm-objdump/llvm-objdump.cpp

  Log Message:
  -----------
  [llvm-objdump] Prevent variable locations to overlap short comments

For now, the source variable locations are printed at about the same
space as the comments for disassembled code, which can make some ranges
for variables disappear if a line contains comments, for example:

                                        ┠─ bar = W1
0:  add x0, x2, #2, lsl #12     // =8192┃
4:  add z31.d, z31.d, #65280    // =0xff00
8:  nop                                 ┻

The patch shifts the report a bit to allow printing comments up to
approximately 16 characters without interferences.

Differential Revision: https://reviews.llvm.org/D104700


  Commit: e7fffa6f032b58d2cf04b05c3992c5195c2dfd56
      https://github.com/llvm/llvm-project/commit/e7fffa6f032b58d2cf04b05c3992c5195c2dfd56
  Author: Igor Kudrin <ikudrin at accesssoftek.com>
  Date:   2021-06-28 (Mon, 28 Jun 2021)

  Changed paths:
    M lld/test/ELF/symver.s
    M lld/test/ELF/wrap-no-real.s
    M lld/test/ELF/x86-64-gotpc-offset.s
    M lld/test/ELF/x86-64-gotpc-relax-nopic.s
    M lld/test/ELF/x86-64-plt.s
    M lld/test/ELF/x86-x32-plt.s
    M lld/test/MachO/dso-handle.s
    M lld/test/MachO/dylink-ordinal.s
    M lld/test/MachO/static-link.s
    M lld/test/MachO/tapi-link.s
    M lld/test/MachO/tlv-dylib.s
    M lld/test/MachO/weak-binding.s
    M lld/test/MachO/x86-64-reloc-signed.s
    M llvm/test/MC/X86/tlsdesc-64.s
    M llvm/test/MC/X86/tlsdesc-x32.s
    M llvm/test/tools/llvm-objdump/X86/disassemble-align.s
    M llvm/test/tools/llvm-objdump/X86/disassemble-gdtls.s
    M llvm/test/tools/llvm-objdump/X86/elf-disassemble-symbol-references.yaml
    M llvm/tools/llvm-objdump/llvm-objdump.cpp

  Log Message:
  -----------
  [llvm-objdump] Prefix memory operand addresses with '0x'

This helps to avoid ambiguity when the address contains only digits 0..9.

Differential Revision: https://reviews.llvm.org/D104909


  Commit: d25e572421a66270c0ee8d51c96256f2958a6f1d
      https://github.com/llvm/llvm-project/commit/d25e572421a66270c0ee8d51c96256f2958a6f1d
  Author: Igor Kudrin <ikudrin at accesssoftek.com>
  Date:   2021-06-28 (Mon, 28 Jun 2021)

  Changed paths:
    M lld/test/MachO/dso-handle.s
    M lld/test/MachO/dylink-ordinal.s
    M lld/test/MachO/mattrs.ll
    M lld/test/MachO/static-link.s
    M lld/test/MachO/tapi-link.s
    M lld/test/MachO/tlv-dylib.s
    M lld/test/MachO/tlv.s
    M lld/test/MachO/weak-binding.s
    M lld/test/MachO/x86-64-reloc-got-load.s
    M lld/test/MachO/x86-64-reloc-signed.s
    M llvm/test/tools/llvm-objdump/X86/disassemble-align.s
    M llvm/tools/llvm-objdump/llvm-objdump.cpp

  Log Message:
  -----------
  [llvm-objdump] Print memory operand addresses as regular comments

The patch reuses the common code to print memory operand addresses as
instruction comments. This helps to align the comments and enables using
target-specific comment markers when `evaluateMemoryOperandAddress()` is
implemented for them.

Differential Revision: https://reviews.llvm.org/D104861


Compare: https://github.com/llvm/llvm-project/compare/04242bdca991...d25e572421a6


More information about the All-commits mailing list