Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH v3 0/2] Widen the stat fields in the remote protocol
@ 2026-10-14  9:21 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-14  9:21 ` [PATCH v3 2/2] gdb: add stat64 and fstat64 to the F-packet file-i/o protocol Abhay Kandpal
  0 siblings, 2 replies; 9+ messages in thread
From: Abhay Kandpal @ 2026-10-14  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.

The struct is used in two directions, and the two need different
fixes:

  1/2  vFile packets (GDB asking gdbserver): a new 'stat64'
       qSupported feature selects a wide struct.  This is v2,
       rebased, with only the commit message adjusted.

  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 v3:
- Add 2/2, covering the F-packet direction as Andrew asked.
  Thanks to Ulrich for suggesting the new-syscall approach.
- 1/2 is unchanged apart from the commit message.

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                                   |  22 +++++
 gdb/doc/gdb.texinfo                        |  96 +++++++++++++++++++
 gdb/remote-fileio.c                        | 102 +++++++++++++++++---
 gdb/remote-fileio.h                        |   4 +
 gdb/remote.c                               |  36 +++++--
 gdb/testsuite/gdb.server/fileio-packets.py |  59 +++++++-----
 gdbserver/hostio.cc                        | 106 +++++++++++++++------
 gdbserver/server.cc                        |   4 +-
 gdbserver/server.h                         |   5 +
 gdbsupport/fileio.cc                       |  70 ++++++++++++++
 gdbsupport/fileio.h                        |  54 ++++++++++-
 11 files changed, 480 insertions(+), 78 deletions(-)

-- 
2.52.0


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

end of thread, other threads:[~2026-10-28 14:20 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2026-10-28 10:42     ` Abhay Kandpal
2026-10-28 14:19       ` Ulrich Weigand

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