From: Abhay Kandpal <abhay@linux.ibm.com>
To: gdb-patches@sourceware.org
Cc: aburgess@redhat.com, Ulrich.Weigand@de.ibm.com, eliz@gnu.org,
cel@linux.ibm.com, abhay.k@ibm.com,
Abhay Kandpal <abhay@linux.ibm.com>
Subject: [PATCH v5 0/2] Widen the stat fields in the remote protocol
Date: Wed, 4 Nov 2026 06:15:19 -0500 [thread overview]
Message-ID: <20261104111521.3042934-1-abhay@linux.ibm.com> (raw)
The struct fio_stat used by the remote protocol declares st_dev,
st_ino, st_nlink, st_rdev and the three timestamps as 4 bytes, so
those values are truncated on a 64-bit host. On a large xfs
filesystem this makes gdb.server/fileio-packets.exp fail. PR 34567.
1/2 vFile packets (GDB asking gdbserver): a new 'stat64'
qSupported feature selects a wide struct.
2/2 F-packet file-i/o calls (the target asking GDB): new
Fstat64 and Ffstat64 calls write the wide struct. An older
GDB replies ENOSYS, so a target can fall back to Fstat.
Changes in v5:
1/2:
- host_to_fileio_uint takes a ULONGEST, so the value is neither
truncated nor sign-extended before the range check (Ulrich,
Andrew). The callers' casts are updated to match.
- Use the protocol's integral types in the struct stat64
documentation, with the standard size paragraph (Andrew).
- Commit message: drop the "cannot use qSupported" wording.
2/2:
- Correct the return-value comment on remote_fileio_write_stat.
- Commit message: drop the "cannot use qSupported" wording.
- Add Andrew's Approved-By.
Abhay Kandpal (2):
gdbserver: widen the stat fields returned by the vFile packets
gdb: add stat64 and fstat64 to the F-packet file-i/o protocol
gdb/NEWS | 23 +++++
gdb/doc/gdb.texinfo | 98 ++++++++++++++++++++++
gdb/remote-fileio.c | 97 ++++++++++++++++++---
gdb/remote-fileio.h | 5 ++
gdb/remote.c | 35 ++++++--
gdb/testsuite/gdb.server/fileio-packets.py | 59 ++++++++-----
gdbserver/hostio.cc | 77 +++++++++--------
gdbserver/hostio.h | 1 +
gdbserver/server.cc | 5 +-
gdbserver/server.h | 5 ++
gdbsupport/fileio.cc | 44 ++++++++--
gdbsupport/fileio.h | 50 +++++++++--
12 files changed, 407 insertions(+), 92 deletions(-)
--
2.51.1
next reply other threads:[~2026-11-04 11:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 11:15 Abhay Kandpal [this message]
2026-11-04 11:15 ` [PATCH v5 1/2] gdbserver: widen the stat fields returned by the vFile packets Abhay Kandpal
2026-11-18 5:00 ` Abhay Kandpal
2026-11-04 11:15 ` [PATCH v5 2/2] gdb: add stat64 and fstat64 to the F-packet file-i/o protocol Abhay Kandpal
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=20261104111521.3042934-1-abhay@linux.ibm.com \
--to=abhay@linux.ibm.com \
--cc=Ulrich.Weigand@de.ibm.com \
--cc=abhay.k@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