Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Farid Khaidari <khaidari.fg@gmail.com>
To: gdb-patches@sourceware.org
Cc: Andrew Burgess <aburgess@redhat.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Timur Golubovich <timurgol007@gmail.com>,
	Kevin Buettner <kevinb@redhat.com>
Subject: [PATCH v2 0/4] gdb/riscv: analyse a core file without the executable
Date: Mon, 26 Oct 2026 12:56:42 +0300	[thread overview]
Message-ID: <20261026095647.3035166-1-khaidari.fg@gmail.com> (raw)
In-Reply-To: <20261022154417.235510-1-khaidari.fg@gmail.com>

A RISC-V core opened without its executable gets an integer-only
target description and is disassembled as plain rv64gc.  This series
takes FLEN from the size of the NT_FPREGSET note and the single-letter
extensions from AT_HWCAP, and passes the resulting ISA to the
disassembler when the object names none.  Vector state is left out:
GDB cannot build a vector target description yet.

Patches 3 and 4 need "[PATCH v2] RISC-V: add an "arch=" disassembler
option" on binutils@sourceware.org.

Changes in v2:

- The core file code moves to riscv-linux-tdep.c as a
  core_read_description hook (patches 1 and 2).
- riscv_print_insn restores disassembler_options after each
  instruction (patch 4).
- The test core files were regenerated on a stock Linux 6.8 kernel.

Tested on x86_64-linux with a riscv64-linux-gnu target: 22 passes, no
failures, and each patch builds and passes its tests on its own.

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                        | 161 +++++++++++++++++-
 gdb/riscv-tdep.c                              |  78 ++++++++-
 gdb/riscv-tdep.h                              |  10 ++
 .../gdb.arch/riscv-core-fpregset.core.bz2     | Bin 0 -> 3204 bytes
 .../gdb.arch/riscv-core-fpregset.exp          |  73 ++++++++
 .../gdb.arch/riscv-core-hwcap.core.bz2        | Bin 0 -> 3229 bytes
 gdb/testsuite/gdb.arch/riscv-core-hwcap.exp   |  67 ++++++++
 .../riscv-disasm-arch-option-vector.xml       | 123 +++++++++++++
 .../gdb.arch/riscv-disasm-arch-option.c       |  40 +++++
 .../gdb.arch/riscv-disasm-arch-option.exp     | 119 +++++++++++++
 10 files changed, 663 insertions(+), 8 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


  parent reply	other threads:[~2026-10-26  9:57 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-22 15:44 [PATCH " 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 ` Farid Khaidari [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261026095647.3035166-1-khaidari.fg@gmail.com \
    --to=khaidari.fg@gmail.com \
    --cc=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=kevinb@redhat.com \
    --cc=palmer@dabbelt.com \
    --cc=timurgol007@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox