Re: [PATCH 1/3] gdb: error if /r and /b are used with disassemble command

Eli Zaretskii
2023-10-21T07:23:25Z

> From: Andrew Burgess <aburgess@redhat.com>
> Cc: Andrew Burgess <aburgess@redhat.com>
> Date: Fri, 20 Oct 2023 22:33:09 +0100
>
> The disassembler gained a new /b flag in this commit:
>
> commit d4ce49b7ac077a9882d6a5e689e260300045ca88
> Date: Tue Jun 21 20:23:35 2022 +0100
>
> gdb: disassembler opcode display formatting
>
> The /b and /r flags result in the instruction opcodes displayed in
> different formats, so it's not possible to have both at the same
> time. Currently the /b flag overrides the /r flag.
>
> We have a similar situation with the /m and /s flags, but here, if the
> user tries to use both flags then they will get an error.
>
> I think the error is clearer, so in this commit I propose that we add
> an error if /r and /b are both used.
>
> Obviously this change breaks backwards compatibility. I don't have a
> compelling argument for why we should make the change beyond my
> feeling that it was a mistake not to add this error from the start,
> and that the new behaviour is better.
> ---
> gdb/NEWS | 7 ++++++
> gdb/cli/cli-cmds.c | 4 +++
> gdb/doc/gdb.texinfo | 20 ++++++++++-----
> gdb/testsuite/gdb.disasm/basics.c | 22 ++++++++++++++++
> gdb/testsuite/gdb.disasm/basics.exp | 39 +++++++++++++++++++++++++++++
> 5 files changed, 86 insertions(+), 6 deletions(-)
> create mode 100644 gdb/testsuite/gdb.disasm/basics.c
> create mode 100644 gdb/testsuite/gdb.disasm/basics.exp

Thanks, the documentation parts are OK.

Reviewed-By: Eli Zaretskii <eliz@gnu.org>