binutils-gdb/gdb/mi
Andrew Burgess 08f406e9a1 gdb/mi: new options for -data-disassemble command
Now that the disassembler has two different strategies for laying out
the opcode bytes of an instruction (see /r vs /b for the disassemble
command), I wanted to add support for this to the MI disassemble
command.

Currently the -data-disassemble command takes a single 'mode' value,
which currently has 6 different values (0 -> 5), 3 of these modes
relate to opcode display.

So, clearly I should just add an additional 3 modes to handle the new
opcode format, right?

No, I didn't think that was a great idea either.

So, I wonder, could I adjust the -data-disassemble command in a
backward compatible way, that would allow GDB to move away from using
the mode value altogether?

I think we can.

In this commit, I propose adding two new options to -data-disassemble,
these are:

  --opcodes none|bytes|display
  --source

Additionally, I will make the mode optional, and default to mode 0 if
no mode value is given.  Mode 0 is the simplest, no source code, no
opcodes disassembly mode.

The two new options are only valid for mode 0, if they are used with
any other mode then an error is thrown.

The --opcodes option can add opcodes to the result, with 'bytes' being
equivalent to 'disassemble /b' and 'display' being 'disassemble /r'.

The --source option will enable the /s style source code display, this
is equivalent to modes 4 and 5.  There is no way, using the new
command options to get the now deprecated /m style source code
display, that is mode 1 and 3.

My hope is that new users of the MI will not use the mode at all, and
instead will just use the new options to achieve the output they need.
Existing MI users can continue to use the mode, and will not need to
be updated to use the new options.
2022-10-02 11:58:28 +01:00
..
ChangeLog-1999-2003
mi-cmd-break.c Eliminate the two-level data structures behind location_specs 2022-06-17 09:55:39 +01:00
mi-cmd-break.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
mi-cmd-catch.c Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
mi-cmd-disas.c gdb/mi: new options for -data-disassemble command 2022-10-02 11:58:28 +01:00
mi-cmd-env.c Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
mi-cmd-file.c gdb: remove SYMTAB_COMPUNIT macro, add getter/setter 2022-02-06 15:48:19 -05:00
mi-cmd-info.c Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
mi-cmd-stack.c gdb: remove TYPE_LENGTH 2022-09-21 11:05:21 -04:00
mi-cmd-target.c Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
mi-cmd-var.c Unify gdb printf functions 2022-03-29 12:46:24 -06:00
mi-cmds.c gdb/mi: fix breakpoint script field output 2022-08-10 15:38:19 -04:00
mi-cmds.h gdb/python: remove gdb._mi_commands dict 2022-03-18 20:29:57 -04:00
mi-common.c Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
mi-common.h Move mi_interpreter to mi-interp.h 2022-06-22 13:28:55 -06:00
mi-console.c Unify gdb putc functions 2022-03-29 12:46:24 -06:00
mi-console.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
mi-getopt.c Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
mi-getopt.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
mi-interp.c Remove a call to clear_interpreter_hooks 2022-08-31 11:03:40 -06:00
mi-interp.h Remove two unused members from mi_interp 2022-08-31 11:03:40 -06:00
mi-main.c gdb/mi: fix breakpoint script field output 2022-08-10 15:38:19 -04:00
mi-main.h gdb/mi: fix breakpoint script field output 2022-08-10 15:38:19 -04:00
mi-out.c Use checked_static_cast in more places 2022-09-12 14:25:06 -06:00
mi-out.h gdb/mi: fix breakpoint script field output 2022-08-10 15:38:19 -04:00
mi-parse.c Remove host_hex_value 2022-02-04 07:37:22 -07:00
mi-parse.h Automatic Copyright Year update after running gdb/copyright.py 2022-01-01 19:13:23 +04:00
mi-symbol-cmds.c Replace symbol_symtab with symbol::symtab 2022-04-20 09:28:40 -06:00