public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/9] Disassembler opcode display and text alignment
@ 2022-06-23 16:05 Andrew Burgess
  2022-06-23 16:05 ` [PATCH 1/9] gdb/doc: improve description of --data-disassemble opcodes output Andrew Burgess
                   ` (10 more replies)
  0 siblings, 11 replies; 25+ messages in thread
From: Andrew Burgess @ 2022-06-23 16:05 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess

This series makes two related changes to GDB's disassembler.  Both
changes flow naturally from having GDB make use of libopcodes
bytes_per_line and bytes_per_chunk presentation hints that are set on
a per-architecure basis with each call into the disassembler.

The end result of this change is that GDB will now display instruction
opcodes in the same way that objdump does.

For x86-64 there's no change in the way that opcode bytes are
presented.  Now due to some special case, it's just that how GDB lays
out instruction opcodes just happens to match how libopcodes requests
that the opcodes be laid out.

For other architectures, risc-v, powerpc, arm, aarch64, etc, this is
not the case, and I (personally) think objdump does a better job of
presenting the information that GDB does; the instruction opcodes will
be grouped together based on the instruction size, and potentially
byte-swapped so they appear in the instruction's natural order.

Making use of the display hints also allows for better alignment of
the disassembly text when opcodes are being printed.

I have proposed that this new behaviour become the default for
'disassemble /r', and I've added a new flag 'disassemble /b' which
allows the user to access the old behaviour.

But, if people feel strongly that the old 'disassemble /r' should not
be changed, I can place the new behaviour under a new flag.

Let me know your thoughts,

Thanks,
Andrew

---

Andrew Burgess (9):
  gdb/doc: improve description of --data-disassemble opcodes output
  gdb/testsuite: new test for -data-disassemble opcodes format
  gdb/disasm: read opcodes bytes with a single read_code call
  gdb: disassembler opcode display formatting
  gdb: make gdb_disassembly_flag unsigned
  gdb/doc: fix column widths in MI compatibility table
  gdb/doc: update syntax of -data-disassemble command arguments
  gdb/mi: some int to bool conversion
  gdb/mi: new options for -data-disassemble command

 gdb/NEWS                                |  12 ++
 gdb/cli/cli-cmds.c                      |   6 +
 gdb/disasm-flags.h                      |   3 +-
 gdb/disasm.c                            |  55 +++++++--
 gdb/disasm.h                            |   3 +
 gdb/doc/gdb.texinfo                     | 137 ++++++++++++++++-----
 gdb/mi/mi-cmd-disas.c                   | 105 ++++++++++++----
 gdb/record.c                            |   3 +
 gdb/testsuite/gdb.mi/mi-disassemble.exp | 153 ++++++++++++++++++++----
 gdb/testsuite/lib/mi-support.exp        |  27 +++++
 10 files changed, 417 insertions(+), 87 deletions(-)

-- 
2.25.4


^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2022-10-02 13:15 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-23 16:05 [PATCH 0/9] Disassembler opcode display and text alignment Andrew Burgess
2022-06-23 16:05 ` [PATCH 1/9] gdb/doc: improve description of --data-disassemble opcodes output Andrew Burgess
2022-06-23 16:09   ` Eli Zaretskii
2022-06-29 12:54     ` Andrew Burgess
2022-06-23 16:05 ` [PATCH 2/9] gdb/testsuite: new test for -data-disassemble opcodes format Andrew Burgess
2022-06-23 16:05 ` [PATCH 3/9] gdb/disasm: read opcodes bytes with a single read_code call Andrew Burgess
2022-06-23 16:05 ` [PATCH 4/9] gdb: disassembler opcode display formatting Andrew Burgess
2022-06-23 16:14   ` Eli Zaretskii
2022-06-23 16:05 ` [PATCH 5/9] gdb: make gdb_disassembly_flag unsigned Andrew Burgess
2022-06-23 16:05 ` [PATCH 6/9] gdb/doc: fix column widths in MI compatibility table Andrew Burgess
2022-06-23 16:22   ` Eli Zaretskii
2022-06-30  9:39     ` Andrew Burgess
2022-06-23 16:05 ` [PATCH 7/9] gdb/doc: update syntax of -data-disassemble command arguments Andrew Burgess
2022-06-23 16:21   ` Eli Zaretskii
2022-06-30 10:18     ` Andrew Burgess
2022-06-30 10:46       ` Eli Zaretskii
2022-06-23 16:05 ` [PATCH 8/9] gdb/mi: some int to bool conversion Andrew Burgess
2022-06-23 16:05 ` [PATCH 9/9] gdb/mi: new options for -data-disassemble command Andrew Burgess
2022-06-23 16:34   ` Eli Zaretskii
2022-06-30 11:22     ` Andrew Burgess
2022-06-30 13:36       ` Eli Zaretskii
2022-07-25 18:28 ` [PATCH 0/9] Disassembler opcode display and text alignment Andrew Burgess
2022-09-05 14:11   ` Andrew Burgess
2022-09-21 16:41 ` Tom Tromey
2022-10-02 13:15   ` Andrew Burgess

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).