Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH v2 0/2] RISC-V: Fix abort when displaying data and add test
@ 2025-02-19  3:35 Charlie Jenkins
  2025-02-19  3:35 ` [PATCH v2 1/2] RISC-V: Fix abort when displaying .dword Charlie Jenkins
  2025-02-19  3:35 ` [PATCH v2 2/2] RISC-V: Add testcase for 6 byte instruction Charlie Jenkins
  0 siblings, 2 replies; 5+ messages in thread
From: Charlie Jenkins @ 2025-02-19  3:35 UTC (permalink / raw)
  To: jiawei, Nelson Chu, Charlie Jenkins, Jan Beulich, Andrew Burgess
  Cc: gdb-patches, Binutils

Commit 6a04e8230707 ("RISC-V: Fix display of partial instructions")
changed how objdump displays instructions. This enabled data of any size
to be dumped. riscv_disassemble_data() only supports data of size 1,
2, 4, or 8 bytes and any other number would cause an abort.

Instead of aborting when encountering one of the other values, dump the
data as ".<N>byte <val>", similar to what is done for instructions with
".insn <N>, <val>".

Signed-off-by: Charlie Jenkins <charlie@rivosinc.com>
---
Changes in v2:
- Dump arbitrary data with ".<N>byte <val>"
- Link to v1: https://lore.kernel.org/r/20250211-fix_gas_abort-v1-0-afd9730f9c51@rivosinc.com

---
Charlie Jenkins (2):
      RISC-V: Fix abort when displaying .dword
      RISC-V: Add testcase for 6 byte instruction

 gas/testsuite/gas/riscv/dis-partial-insn-dword.d | 12 ++++++++++++
 gas/testsuite/gas/riscv/dis-partial-insn-dword.s |  2 ++
 gas/testsuite/gas/riscv/dis-partial-insn-word.d  |  2 +-
 opcodes/riscv-dis.c                              | 19 ++++++++++---------
 4 files changed, 25 insertions(+), 10 deletions(-)
---
base-commit: f1ffed29357a30162506c0c895f2927c7c2a4aba
change-id: 20250211-fix_gas_abort-6d1e28b4ad46
-- 
- Charlie


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

end of thread, other threads:[~2025-02-19 17:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-19  3:35 [PATCH v2 0/2] RISC-V: Fix abort when displaying data and add test Charlie Jenkins
2025-02-19  3:35 ` [PATCH v2 1/2] RISC-V: Fix abort when displaying .dword Charlie Jenkins
2025-02-19  3:35 ` [PATCH v2 2/2] RISC-V: Add testcase for 6 byte instruction Charlie Jenkins
2025-02-19  9:25   ` Jan Beulich
2025-02-19 17:11     ` Charlie Jenkins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox