]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - binutils/NEWS
s390: Optionally print instruction description in disassembly
authorJens Remus <jremus@linux.ibm.com>
Wed, 20 Dec 2023 10:34:15 +0000 (11:34 +0100)
committerAndreas Krebbel <krebbel@linux.ibm.com>
Wed, 20 Dec 2023 10:50:32 +0000 (11:50 +0100)
commitf96fe7f454bdd077abec2acc415f546bb5646189
treeee9abf7a8ffe9b9d36236bab978e8a9da980062e
parenta3fa108623c51846ff019fbcba9f483897d6f5f7
s390: Optionally print instruction description in disassembly

Print instruction description as comment in disassembly with s390
architecture specific option "insndesc":

- For objdump it can be enabled with option "-M insndesc"
- In gdb it can be enabled with "set disassembler-options insndesc"

Since comments are not column aligned the output can enhanced for
readability by postprocessing using a filter such as "expand":

... | expand -t 8,16,24,32,40,80

Or when using in combination with objdump option --visualize-jumps:

... | expand | sed -e 's/ *#/\t#/' | expand -t 1,80

Note that the instruction descriptions add about 128 KB to s390-opc.o:

s390-opc.o without instruction descriptions: 216368 bytes
s390-opc.o with instruction descriptions   : 348432 bytes

binutils/
* NEWS: Mention new s390-specific disassembler option
  "insndesc".

include/
* opcode/s390.h (struct s390_opcode): Add field to hold
  instruction description.

opcodes/
* s390-mkopc.c: Copy instruction description from s390-opc.txt
  into generated operation code table s390-opc.tab.
* s390-opc.c (s390_opformats): Provide NULL as description in
  .insn pseudo-mnemonics opcode table.
* s390-dis.c: Add s390-specific disassembler option "insndesc"
  and optionally print the instruction description as comment in
  the disassembly when it is specified.

gas/
* testsuite/gas/s390/s390.exp: Add new test disassembly test
  case "zarch-insndesc".
* testsuite/gas/s390/zarch-insndesc.s: New test case for s390-
  specific disassembler option "insndesc".
* testsuite/gas/s390/zarch-insndesc.d: Likewise.

Signed-off-by: Jens Remus <jremus@linux.ibm.com>
Reviewed-by: Andreas Krebbel <krebbel@linux.ibm.com>
binutils/NEWS
gas/testsuite/gas/s390/s390.exp
gas/testsuite/gas/s390/zarch-insndesc.d [new file with mode: 0644]
gas/testsuite/gas/s390/zarch-insndesc.s [new file with mode: 0644]
include/opcode/s390.h
opcodes/s390-dis.c
opcodes/s390-mkopc.c
opcodes/s390-opc.c