From: Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
To: Abhay Kandpal <abhay@linux.ibm.com>,
"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Cc: Andrew Burgess <aburgess@redhat.com>,
"eliz@gnu.org" <eliz@gnu.org>,
"cel@linux.ibm.com" <cel@linux.ibm.com>,
Abhay Kandpal <Abhay.k@ibm.com>
Subject: Re: [PATCH v3 2/2] gdb: add stat64 and fstat64 to the F-packet file-i/o protocol
Date: Tue, 27 Oct 2026 17:47:02 +0000 [thread overview]
Message-ID: <21b9f02739bfd9fc0f57368050b5fa98de9c5e05.camel@de.ibm.com> (raw)
In-Reply-To: <20261014092139.399322-3-abhay@linux.ibm.com>
Abhay Kandpal <abhay@linux.ibm.com> wrote:
>The F-packet calls cannot use qSupported, since the buffer is read
>directly by the target. But each request names the call it wants, so
>add two new calls, Fstat64 and Ffstat64, which are identical to Fstat
>and Ffstat except that they write struct fio_stat_wide. Existing
>targets keep using Fstat and Ffstat and see no change. A GDB which
>does not know the new calls already replies with ENOSYS, so a target
>can try Fstat64 and fall back to Fstat.
This makes sense to me, if support for this is needed. I'm not
really sure who -if anyone- is using these F-packets; gdbserver
doesn't seem to do so and there's no test in the test suite ...
Andrew, do you have any thoughts on this?
>The console case in the fstat handler stored 1 into fst_dev, but that
>was then overwritten when the struct was packed, so the target always
>saw zero. Drop the dead store; behaviour is unchanged.
Interesting. Seems this accidentally changed here:
https://sourceware.org/pipermail/gdb-patches/2015-March/122143.html
which says:
(remote_fileio_mode_to_target): Moved to common-remote-
fileio.c.
(remote_fileio_to_fio_mode): Likewise.
(remote_fileio_to_fio_ulong): Likewise.
(remote_fileio_to_fio_stat): Likewise.
but in addition to the move, changed:
-static void
-remote_fileio_to_fio_stat (struct stat *st, struct fio_stat *fst)
-{
- LONGEST blksize;
-
- /* `st_dev' is set in the calling function. */
- remote_fileio_to_fio_uint ((long) st->st_ino, fst->fst_ino);
to:
+void
+remote_fileio_to_fio_stat (struct stat *st, struct fio_stat *fst)
+{
+ LONGEST blksize;
+
+ remote_fileio_to_fio_uint ((long) st->st_dev, fst->fst_dev);
+ remote_fileio_to_fio_uint ((long) st->st_ino, fst->fst_ino);
So up until 2015 fst_dev was indeed 1 for the console and
0 for everything else, and since then it's been 0 always.
Given that long time, it may be fine to keep it at 0 now ...
On the other hand, the documentation still says:
@item st_dev
A value of 0 represents a file, 1 the console.
So we can either fix the code again, or else update the
documentation to match the behavior over the last 10 years.
Thoughts?
Bye,
Ulrich
next prev parent reply other threads:[~2026-10-27 17:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-14 9:21 [PATCH v3 0/2] Widen the stat fields in the remote protocol Abhay Kandpal
2026-10-14 9:21 ` [PATCH v3 1/2] gdbserver: widen the stat fields returned by the vFile packets Abhay Kandpal
2026-10-27 17:27 ` Ulrich Weigand
2026-10-27 22:16 ` Andrew Burgess
2026-10-14 9:21 ` [PATCH v3 2/2] gdb: add stat64 and fstat64 to the F-packet file-i/o protocol Abhay Kandpal
2026-10-14 11:47 ` Eli Zaretskii
2026-10-27 17:47 ` Ulrich Weigand [this message]
2026-10-28 10:42 ` Abhay Kandpal
2026-10-28 14:19 ` Ulrich Weigand
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=21b9f02739bfd9fc0f57368050b5fa98de9c5e05.camel@de.ibm.com \
--to=ulrich.weigand@de.ibm.com \
--cc=Abhay.k@ibm.com \
--cc=abhay@linux.ibm.com \
--cc=aburgess@redhat.com \
--cc=cel@linux.ibm.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
/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