Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH 0/4] gdb/riscv: analyse a core file without the executable
@ 2026-10-22 15:44 Farid Khaidari
  2026-10-22 15:44 ` [PATCH 1/4] gdb/riscv: recover FLEN from the NT_FPREGSET note size in core files Farid Khaidari
                   ` (5 more replies)
  0 siblings, 6 replies; 16+ messages in thread
From: Farid Khaidari @ 2026-10-22 15:44 UTC (permalink / raw)
  To: gdb-patches
  Cc: Farid Khaidari, Andrew Burgess, Palmer Dabbelt, Timur Golubovich

A RISC-V core opened without its executable gets an integer-only
target description, because the core does not say how wide the FP
registers are.  Any object with no ISA attribute, a core included, is
also disassembled as plain rv64gc.

This series reads what the core does record.  The size of the
NT_FPREGSET note gives FLEN, and AT_HWCAP gives the single-letter
extensions.  The last patch passes the ISA of the resulting target
description to the disassembler when the object names none.

Patches 3 and 4 need the "arch=" disassembler option, sent to
binutils@sourceware.org as "RISC-V: add an "arch=" disassembler
option".

Vector state from the NT_RISCV_VECTOR note is left out.  GDB can read
the org.gnu.gdb.riscv.vector feature from a target description but
cannot build one, so a vlen read from the core has nowhere to go yet.
The disassembler test loads a vector description from a file instead.

Tested on x86_64-linux with a riscv64-linux-gnu target: the three new
tests give 23 passes and no failures.  The host cannot run RISC-V
binaries, so I did not run the rest of the testsuite.

Farid Khaidari (4):
  gdb/riscv: recover FLEN from the NT_FPREGSET note size in core files
  gdb/riscv: recover core file ISA features from AT_HWCAP
  gdb/riscv: test the "arch=" disassembler option
  gdb/riscv: disassemble an attribute-less object by the description ISA

 gdb/riscv-linux-tdep.c                        | 120 +++++++++++++
 gdb/riscv-tdep.c                              | 167 +++++++++++++++++-
 gdb/riscv-tdep.h                              |  14 ++
 .../gdb.arch/riscv-core-fpregset.core.bz2     | Bin 0 -> 15134 bytes
 .../gdb.arch/riscv-core-fpregset.exp          |  78 ++++++++
 .../gdb.arch/riscv-core-hwcap.core.bz2        | Bin 0 -> 15122 bytes
 gdb/testsuite/gdb.arch/riscv-core-hwcap.exp   |  72 ++++++++
 .../riscv-disasm-arch-option-vector.xml       | 123 +++++++++++++
 .../gdb.arch/riscv-disasm-arch-option.c       |  40 +++++
 .../gdb.arch/riscv-disasm-arch-option.exp     | 124 +++++++++++++
 10 files changed, 732 insertions(+), 6 deletions(-)
 create mode 100644 gdb/testsuite/gdb.arch/riscv-core-fpregset.core.bz2
 create mode 100644 gdb/testsuite/gdb.arch/riscv-core-fpregset.exp
 create mode 100644 gdb/testsuite/gdb.arch/riscv-core-hwcap.core.bz2
 create mode 100644 gdb/testsuite/gdb.arch/riscv-core-hwcap.exp
 create mode 100644 gdb/testsuite/gdb.arch/riscv-disasm-arch-option-vector.xml
 create mode 100644 gdb/testsuite/gdb.arch/riscv-disasm-arch-option.c
 create mode 100644 gdb/testsuite/gdb.arch/riscv-disasm-arch-option.exp

-- 
2.43.0


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

end of thread, other threads:[~2026-10-27 14:32 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-22 15:44 [PATCH 0/4] gdb/riscv: analyse a core file without the executable Farid Khaidari
2026-10-22 15:44 ` [PATCH 1/4] gdb/riscv: recover FLEN from the NT_FPREGSET note size in core files Farid Khaidari
2026-10-25 20:07   ` Kevin Buettner
2026-10-26 10:01     ` Farid Khaidari
2026-10-22 15:44 ` [PATCH 2/4] gdb/riscv: recover core file ISA features from AT_HWCAP Farid Khaidari
2026-10-22 15:44 ` [PATCH 3/4] gdb/riscv: test the "arch=" disassembler option Farid Khaidari
2026-10-22 15:44 ` [PATCH 4/4] gdb/riscv: disassemble an attribute-less object by the description ISA Farid Khaidari
2026-10-25 20:50   ` Kevin Buettner
2026-10-26 10:01     ` Farid Khaidari
2026-10-25 20:17 ` [PATCH 0/4] gdb/riscv: analyse a core file without the executable Kevin Buettner
2026-10-26  9:56 ` [PATCH v2 " Farid Khaidari
2026-10-26  9:56   ` [PATCH v2 1/4] gdb/riscv: recover FLEN from the NT_FPREGSET note size in core files Farid Khaidari
2026-10-26  9:56   ` [PATCH v2 2/4] gdb/riscv: recover core file ISA features from AT_HWCAP Farid Khaidari
2026-10-26  9:56   ` [PATCH v2 3/4] gdb/riscv: test the "arch=" disassembler option Farid Khaidari
2026-10-26  9:56   ` [PATCH v2 4/4] gdb/riscv: disassemble an attribute-less object by the description ISA Farid Khaidari
2026-10-27 14:31   ` [PATCH v2 0/4] gdb/riscv: analyse a core file without the executable Farid Khaidari

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