Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH v4 0/2] Widen the stat fields in the remote protocol
@ 2026-10-29  9:21 Abhay Kandpal
  2026-10-29  9:21 ` [PATCH v4 1/2] gdbserver: widen the stat fields returned by the vFile packets Abhay Kandpal
  2026-10-29  9:21 ` [PATCH v4 2/2] gdb: add stat64 and fstat64 to the F-packet file-i/o protocol Abhay Kandpal
  0 siblings, 2 replies; 3+ messages in thread
From: Abhay Kandpal @ 2026-10-29  9:21 UTC (permalink / raw)
  To: gdb-patches; +Cc: aburgess, Ulrich.Weigand, eliz, cel, abhay.k, Abhay Kandpal

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 v4:

1/2, addressing Ulrich's and Andrew's review:
- Pack struct stat directly into the negotiated form, dropping the
  wide-to-narrow conversion and its helpers.
- Reuse remote_fileio_to_host_ulong and host_to_fileio_ulong.
- Factor the three vFile stat replies into hostio_send_stat_reply.
- Reset the stat64 feature flag on each new connection.
- Move the truncation warning into host_to_fileio_uint and
  host_to_fileio_time.  These are shared with the F-packet path, so
  GDB's Fstat and Ffstat now warn on truncation too.
- Style fixes, and commit message corrections: seven fields, not
  six, and no ChangeLog.

2/2:
- Drop the ChangeLog.  Whether F-packet support is wanted is still
  open; 2/2 can be dropped without affecting 1/2.

Both patches are rebased on current master.

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                        | 96 +++++++++++++++++++++
 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                       | 32 +++++++
 gdbsupport/fileio.h                        | 48 +++++++++--
 12 files changed, 398 insertions(+), 85 deletions(-)

-- 
2.51.1


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

end of thread, other threads:[~2026-10-29  9:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-29  9:21 [PATCH v4 0/2] Widen the stat fields in the remote protocol Abhay Kandpal
2026-10-29  9:21 ` [PATCH v4 1/2] gdbserver: widen the stat fields returned by the vFile packets Abhay Kandpal
2026-10-29  9:21 ` [PATCH v4 2/2] gdb: add stat64 and fstat64 to the F-packet file-i/o protocol Abhay Kandpal

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