From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id iliBLQtsz2pxbQgAWB0awg (envelope-from ) for ; Wed, 14 Oct 2026 07:48:27 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=gnu.org header.i=@gnu.org header.a=rsa-sha256 header.s=fencepost-gnu-org header.b=QkIx0HM5; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 7F27B1E051; Wed, 14 Oct 2026 07:48:27 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id EBFFE1E04E for ; Wed, 14 Oct 2026 07:48:25 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 465404BA23D6 for ; Wed, 14 Oct 2026 11:48:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 465404BA23D6 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gnu.org header.i=@gnu.org header.a=rsa-sha256 header.s=fencepost-gnu-org header.b=QkIx0HM5 Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 0D7CB4BA2E0F for ; Wed, 14 Oct 2026 11:47:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0D7CB4BA2E0F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0D7CB4BA2E0F Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2001:470:142:3::10 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1791978478; cv=none; b=Ix8zbX5FMzvW6bf+Dt9hCyxUodPpnCXP1rFJgkgezDz2JrnpZGqtq+vU2kQ7ez86XwdHCDwT2kzWDl/PytZxpfeu43PeYJDhPcvpb8kjIz5qlyElwU6Hzej57yxsHOkPBHzGHLMtXBZ6V/CqIEnpir3ZnPVd1tdwTBiONSferog= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1791978478; c=relaxed/simple; bh=TeULErq9BiXPXBUh4CfDugLBZLh0w2W5dbhOjPq6SnM=; h=DKIM-Signature:Date:Message-Id:From:To:Subject; b=QyFT67PI9ZAA/sVr6g2XeT67RIsuGZs0y7fZigeP1x6Z4aA1OCmVpBLgoFpPa5F9eJcyC3Z39SV2OdUimxhL+URkjyDXiFr+wAZv9rmycsreMMV8lPBsT1D4p5OsAYmTgyW1hllMAl8MyUHyXWjSeWjxdg5n8dg/HAq3cU+tdkY= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gnu.org header.i=@gnu.org header.a=rsa-sha256 header.s=fencepost-gnu-org header.b=QkIx0HM5 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0D7CB4BA2E0F Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1xGxSd-0001DF-38; Wed, 14 Oct 2026 07:47:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Pef5UeVCvpTYfyeudvAuwNI6v6C2tcfq1jVW1hugopw=; b=QkIx0HM5KQ8x 8hDbBQis0o9ljeh4LhVJxLYhdLTJjkJ7siI9HGCWfWKszl2NYaX6QJlur114g/AK6az1DoGSeMEFO Lefu5JRwXw5xfvGJDBGt3xNuSEBfSoWJVyTV07mqKK8mJhIkdeJVmNzCOc0q/fnu7Yj724xPONGai l3tnvBnrRix3GbwnAjf4H+0vy9leH3TPN+mlq3QFpO3uu7UuRnNHsDvGTNfLwhsprHbpJpxUChDQq Yw0Fp4a08lQJlOqCWN2+urIDVsh1ooChTO7ocV0F2Sv1htTW1Ke4ReMNk+ROwSeSnMNavflkFOU+K hetlH5MvEV1OL7eSSHZ8kw==; Date: Wed, 14 Oct 2026 14:47:51 +0300 Message-Id: <86h5ioec60.fsf@gnu.org> From: Eli Zaretskii To: Abhay Kandpal Cc: gdb-patches@sourceware.org, aburgess@redhat.com, Ulrich.Weigand@de.ibm.com, cel@linux.ibm.com, abhay.k@ibm.com In-Reply-To: <20261014092139.399322-3-abhay@linux.ibm.com> (message from Abhay Kandpal on Wed, 14 Oct 2026 04:21:39 -0500) Subject: Re: [PATCH v3 2/2] gdb: add stat64 and fstat64 to the F-packet file-i/o protocol References: <20261014092139.399322-1-abhay@linux.ibm.com> <20261014092139.399322-3-abhay@linux.ibm.com> X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org > From: Abhay Kandpal > Cc: aburgess@redhat.com, Ulrich.Weigand@de.ibm.com, eliz@gnu.org, > cel@linux.ibm.com, abhay.k@ibm.com, > Abhay Kandpal > Date: Wed, 14 Oct 2026 04:21:39 -0500 > > The previous patch widened the stat fields returned by the vFile > packets, using a qSupported feature to keep old and new GDB and > gdbserver compatible. The F-packet file-i/o protocol has the same > problem: the Fstat and Ffstat calls write struct fio_stat into target > memory, in which st_dev, st_ino, st_nlink, st_rdev and the three > timestamps are 4 bytes, so those values are truncated on a 64-bit > host. > > 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. > > The stat and fstat handlers become remote_fileio_do_stat and > remote_fileio_do_fstat, with a flag selecting the layout, and share a > new remote_fileio_write_stat helper. The stat handler has always > reported st_dev as zero; that is now done on the struct stat before > packing, which gives the same result in either layout. > > 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. > > gdb/ > * NEWS: Mention the Fstat64 and Ffstat64 calls. > * doc/gdb.texinfo (List of Supported Calls): Add stat64/fstat64. > (stat/fstat): Refer to stat64/fstat64. > (stat64/fstat64): New node. > (struct stat64): Mention the Fstat64 and Ffstat64 calls. > * remote-fileio.c (remote_fileio_write_stat): New function. > (remote_fileio_do_stat): Renamed from remote_fileio_func_stat. > Add WIDE parameter. > (remote_fileio_func_stat): Call remote_fileio_do_stat. > (remote_fileio_func_stat64): New function. > (remote_fileio_do_fstat): Renamed from remote_fileio_func_fstat. > Add WIDE parameter. Remove dead store to fst_dev. > (remote_fileio_func_fstat): Call remote_fileio_do_fstat. > (remote_fileio_func_fstat64): New function. > (remote_fio_func_map): Add stat64 and fstat64. > > gdbsupport/ > * fileio.h (struct fio_stat, struct fio_stat_wide): Update > comments. > > Tested on powerpc64le-linux, on an xfs filesystem with inode numbers > above 2^32, using a fake remote stub which issues File-I/O requests > and checks the buffer GDB writes into target memory. Fstat64 and > Ffstat64 return the full inode number; Fstat and Ffstat return the > same truncated values as before. An unpatched GDB answers Fstat64 > and Ffstat64 with ENOSYS. gdb.server/fileio-packets.exp continues > to pass. > > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=34567 > Suggested-by: Ulrich Weigand > --- > gdb/NEWS | 9 ++++++ > gdb/doc/gdb.texinfo | 52 +++++++++++++++++++++++++++++++++-- > gdb/remote-fileio.c | 67 +++++++++++++++++++++++++++++++++++++-------- > gdbsupport/fileio.h | 14 +++++----- > 4 files changed, 120 insertions(+), 22 deletions(-) Thanks, the documentation parts are approved. Reviewed-By: Eli Zaretskii