From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 4WpfLoAa6mo8sQsAWB0awg (envelope-from ) for ; Tue, 03 Nov 2026 12:31:44 -0500 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=iyG5+rKb; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id AE55F378002; Tue, 03 Nov 2026 12:31:44 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.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 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 B9EBA1E043 for ; Tue, 03 Nov 2026 12:31:43 -0500 (EST) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 032694BA2E3E for ; Tue, 3 Nov 2026 17:31:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 032694BA2E3E Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=iyG5+rKb Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 5D0AE4BA2E38 for ; Tue, 3 Nov 2026 17:31:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5D0AE4BA2E38 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5D0AE4BA2E38 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1793727079; cv=none; b=ZQX9MHY7xRwFJSoHjZh7Rn4ahmE3Sv+Lx66StVMefD/+v8jLaRyiXocwaDqPk2ZkU9xlTd8ufE3DVNuMfq4R6AzM7Gw4tV4K9LinQgBp255JEofVFCkY1iwvvd0/lJzh4M/9mG8xhNFxY5QXNUjBUbulKIbaE2NkFBO5fMKSc1A= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1793727079; c=relaxed/simple; bh=aV2TfE6ddcFQ2RqbgHf7Ol0tON2p/68jkVx7Hs8Hvok=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=fhkuLOfdmplj0pYQ4oGQSVNQ5CuFE6FIMwnRhz2PTBh5aGkbURzalhug1SkIzyD0ApWb+tafOycIe62KhQcJDvGRHDGz/hsskslTkH5TTbJo+avFW4soeXGjHBNyjs9KtSfwlFSBtgzanmFiNaPDATTawTK0reVZXnN2fM5dHHQ= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=iyG5+rKb DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5D0AE4BA2E38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1793727078; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=k+ZpSYIlua32/i5ixwqkD4rwJq2Px4zp0CwjPZ8neJ8=; b=iyG5+rKb8F7nZ4QqlBLVPW9rqtxSesMt9hgVxopvpqgJq1ljUJtfcrEUUTMDQpk2U3WX0G 30rl7b5DKWb2Rk7jszKPnNCBKFyiPmvO667oJLHTf9QDPW5Kqt7vS/rO+MNnBUrfYZkqU3 kI2/NRtgptA/1bLU2gTk7xtEVERKhYI= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-304-VmTKidGvM8KQkksThSaMRQ-1; Tue, 03 Nov 2026 12:31:17 -0500 X-MC-Unique: VmTKidGvM8KQkksThSaMRQ-1 X-Mimecast-MFC-AGG-ID: VmTKidGvM8KQkksThSaMRQ_1793727076 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4ad3d35e899so27107955e9.1 for ; Tue, 03 Nov 2026 09:31:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793727076; x=1794331876; h=content-type:mime-version:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to:content-type; bh=k+ZpSYIlua32/i5ixwqkD4rwJq2Px4zp0CwjPZ8neJ8=; b=d+7SFvs21FBGZlyZYJI6cczw4bi00c1m0OpSFoD2cwiE+bUieJgmtMl4nTVIwPTCJ4 uWFo9Xgmt69mhbLoAzDkqxvlsMnhpWnn/lMY4zu9eJEIG2z0Cgr0g8i3X6YOq/rafG1O rh4K3EO6tSnWnfBO/V6CGcUpIDOfeJIXzABcIUbjN+GGa58ZgQEHwZbeS6+mmkbUDzqD nQoptxwpxGHDHvCFKjC/mrkrFSKEdN5gR58uqt1MxfVYSakMihiN9IaYZvCzxKFPNTYI 9pRA/FTt/LCOI5j03uB9yQpjv72w/xWS8fVPP+xrJRgEaFEcTxuVYoUTU09/4oJcV6sg u+7w== X-Forwarded-Encrypted: i=1; AKwUvBzo7ZuVpovOxG7NedRGg7svbRwzcwTpNgHNGs8CxKZrOEg45CowsAOdSICALvFGkWyALlAsCUeaZE4CsA==@sourceware.org X-Gm-Message-State: APuU4Z8z2v9gihnjCccqsBeLmlX94bjWjXo3oqmYYcXYA73vD9ZWWdfW quzAbde5zkdJbkJySXQ9aaBKrrwxbFX1WrG4HrbgwrGBQ5vhOgnU2oASNR8QkoNuSaohGk7CHnQ MCv8AhqTb+EGQljxO/eYH+3kdNTnhpXVqQdE+r2gVio/DnC6pMV8VIpi73pJLM2w= X-Gm-Gg: AYBFou2khCvDdX0dpRoxjb+LEZn6qnOxWVoG4rGlz2X2uTZEYcxwXmRpVmhc+htplT5 c2TyvrZ2m8RG2mLBvdPApOJyhPUhNfGF7LgxmEcyy8tp3LOYeB5GPirL5sD01E4T7jNRYoDHe6K rnCNdHRutypsP0W38BP9jQ9nYDlwHb8FEKhJ1dfvw/7ODI9g0ZbxcECIP9uOflemDMLNQyMNslk EIWv+7ME6tqOIJkks3/8E4qNT+4/3G71UuSqMBmQipFmTOVO6vaBKiGVBbL9BItP/+A0YI4YobP 5MlBfDDO5rgVA/ovmUj+ADcTAvrjdce2dNqH2WZQDHlA1gdYa7r19TS2jaFjzhgChDTv38wpBy8 NAig3g8gOMQ6Ec6fnGOpZdWtUMU/JLzQdNcY2cqx8iA== X-Received: by 2002:a05:600c:8b85:b0:4a2:392:9de2 with SMTP id 5b1f17b1804b1-4ac1932b550mr279384535e9.28.1793727076433; Tue, 03 Nov 2026 09:31:16 -0800 (PST) X-Received: by 2002:a05:600c:8b85:b0:4a2:392:9de2 with SMTP id 5b1f17b1804b1-4ac1932b550mr279383965e9.28.1793727076002; Tue, 03 Nov 2026 09:31:16 -0800 (PST) Received: from localhost ([213.31.44.62]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4b2a9faff90sm84187415e9.5.2026.11.03.09.31.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Nov 2026 09:31:15 -0800 (PST) From: Andrew Burgess To: Abhay Kandpal , gdb-patches@sourceware.org Cc: Ulrich.Weigand@de.ibm.com, eliz@gnu.org, cel@linux.ibm.com, abhay.k@ibm.com, Abhay Kandpal Subject: Re: [PATCH v4 2/2] gdb: add stat64 and fstat64 to the F-packet file-i/o protocol In-Reply-To: <20261029092124.233055-3-abhay@linux.ibm.com> References: <20261029092124.233055-1-abhay@linux.ibm.com> <20261029092124.233055-3-abhay@linux.ibm.com> Date: Tue, 03 Nov 2026 17:31:13 +0000 Message-ID: <874idx7rfi.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 7WuEQhCGnEF2Roi32b9EC57Ed4wjzYQ3l_wpCPDWW9k_1793727076 X-Mimecast-Originator: redhat.com Content-Type: text/plain 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 Abhay Kandpal writes: > 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 I find this discussion on qSupported here a little distracting. I agree with the conclusion that this paragraph reaches, that there's no benefit to using qSupported here, but I disagree with the "cannot use qSupported" claim. Right now, a remote target that wants to use the file-i/o (F-packet) mechanism will be running code that does . At some point it will do a syscall which the gdbserver will intercept. The syscall is translated into an F-packet. It's gdbserver which gets to decide which F-packet stat or stat64 to send, so why can the stub not be influenced or controlled by the existing qSupported feature? I mean, if you are talking to a GDB that we know (thanks to qSupported) will only have the stat F-packet, then translating 'stat' syscalls into 'stat64' F-packets seems like a bad plan. Better (surely) to send of the 'stat' F-packet and hope that we don't hit any overflow? But I do understand that we cannot make use of the qSupported knowledge to mangle the buffer sizes on the remote end as GDB writes directly back into the target. I'm not sure I'm really arguing that any code needs to change, I'm just arguing that the "The F-packet calls cannot use qSupported, " part (to me) adds confusion as the real situation is more complex that the text indicates. I think just dropping that part would actually be clearer. Or expanding the explanation to explain the limitations of qSupported in this area. But I'd just drop it I think. > diff --git a/gdb/remote-fileio.c b/gdb/remote-fileio.c > index a65db27d04e..c24c3c2ab9f 100644 > --- a/gdb/remote-fileio.c > +++ b/gdb/remote-fileio.c > @@ -791,14 +791,39 @@ remote_fileio_func_unlink (remote_target *remote, char *buf) > remote_fileio_return_success (remote, ret); > } > > +/* Write ST into target memory at ADDR, using the struct fio_stat > + layout or, if WIDE, the struct fio_stat_wide layout. Return 0 on > + success, or an errno value. */ This comment is wrong. See target_write_memory, but it's 0 on success, -1 on error, not a POSIX errno. With those two fixes: Approved-By: Andrew Burgess Thanks, Andrew