Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@redhat.com>
To: Farid Khaidari <khaidari.fg@gmail.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 1/4] gdb/riscv: recover FLEN from the NT_FPREGSET note size in core files
Date: Sun, 25 Oct 2026 13:07:10 -0700	[thread overview]
Message-ID: <32cc0c22-1fbf-4b10-92fa-906fad95564a@redhat.com> (raw)
In-Reply-To: <20261022154417.235510-2-khaidari.fg@gmail.com>

Hi Farid,

On 10/22/26 8:44 AM, Farid Khaidari wrote:
> A Linux kernel core has no float ABI in e_flags and no RISC-V
> attributes.  Opened without the executable, it gets an integer-only
> target description, and "p $fa0" fails with "Invalid register 'fa0'"
> even though the core holds the FP state.
> 
> The kernel writes 32 FP registers of FLEN bytes plus fcsr into
> NT_FPREGSET, so the note size gives FLEN.  Use it when e_flags says
> nothing.
> 
> The test core is a real kernel dump with a 264-byte NT_FPREGSET,
> i.e. FLEN = 8.
> 
> Signed-off-by: Farid Khaidari <khaidari.fg@gmail.com>
> ---
>  gdb/riscv-tdep.c                              |  89 +++++++++++++++++-

I don't think that riscv-tdep.c is the correct place to add knowledge
about linux specific features.  It seems to me that much of what you've
done here ought to be placed in gdb/riscv-linux-tdep.c.

If it's not truly linux-specific, but would be of benefit to other riscv
platforms, then this should be explained in the commit log as well as in
the code comments too.

Kevin


  reply	other threads:[~2026-10-25 20:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=32cc0c22-1fbf-4b10-92fa-906fad95564a@redhat.com \
    --to=kevinb@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=khaidari.fg@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