From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 6WgPGWZ4oGlTVwsAWB0awg (envelope-from ) for ; Thu, 26 Feb 2026 11:44:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1772124262; bh=VznOGeD24cwYNucX9zfpHoNeoI065MhVERg0FpNNMTo=; h=Date:Subject:To:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=roDnr1Eb5NaF6kccMXoF4P4yRDJLuZbnSyLcp0EKUNHbdhElnLcXOofZ3grEPVMh1 ypJobYB/7S3JinsC0BXfvWpZ3aWNmeeKIyEsKyhQWKeBwf5tPBv2YdP0PLvgoEid6L BVkruzTFTkD4HrUy/NVY9d5wn3V7hxHbUmutdQHw= Received: by simark.ca (Postfix, from userid 112) id 4D52C1E0DD; Thu, 26 Feb 2026 11:44:22 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, 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 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=IoD99lnF; dkim-atps=neutral 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 B093B1E089 for ; Thu, 26 Feb 2026 11:44:21 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 48BCB4B9DB72 for ; Thu, 26 Feb 2026 16:44:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 48BCB4B9DB72 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=IoD99lnF Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 5C9FA4BA2E0F for ; Thu, 26 Feb 2026 16:43:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5C9FA4BA2E0F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5C9FA4BA2E0F Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1772124237; cv=none; b=I0syPUG3wHtXGd0eHlbizlGyXO7uSwYIGVm6fTQSxxS6bCISxrROixILD3VwOCGBqiEVWLV08s3HcUqpa8bB8NpzoBJdKHUtl+Nv+CPKkFghIVOQ6nwzCx4C4gDH7tFLqT8VrXZyg2IybfqI9pJXIQ7ESr7GezcdzqKKF7SQn+U= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1772124237; c=relaxed/simple; bh=VznOGeD24cwYNucX9zfpHoNeoI065MhVERg0FpNNMTo=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=ApjP8iWHZvuDDE9Z8dvDWkEwb69LEsQYw2CGTNYDRskbf1j30NSzvhz7R4536bgsdnZFk5WitINId9oylXj751on2BeZknYI8ndMJ25AxIPGmrsXJAIHLdTOa/ICt27oGqjS2FAH/MvN8ylWobAH1HgY3qTL+cuBWhhDOuoa/j0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5C9FA4BA2E0F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1772124235; bh=VznOGeD24cwYNucX9zfpHoNeoI065MhVERg0FpNNMTo=; h=Date:Subject:To:References:From:In-Reply-To:From; b=IoD99lnFRPjYvJFJPUMSacPmuAmty9GMJhri/mUekob7/ynBqWgB6FJ+3J6CFeA1q tD7WrQQViNLfTUi7UMKntlDB9kWRP8bZvyLfHh497hK4Yzri/lTjKpBeCkGy7Pddjz 7R93kynLlATkc54HPbJXdVgJUEP9Pyq3oPjP/ra4= Received: by simark.ca (Postfix) id 2ADC31E089; Thu, 26 Feb 2026 11:43:55 -0500 (EST) Message-ID: <32b6cfc1-d500-462c-a14d-4999e66afe76@simark.ca> Date: Thu, 26 Feb 2026 11:43:54 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] Use a newtype for remote file descriptor To: Tom Tromey , gdb-patches@sourceware.org References: <20260225-target-fd-newtype-v1-0-e04af6692ccb@adacore.com> <20260225-target-fd-newtype-v1-1-e04af6692ccb@adacore.com> Content-Language: fr From: Simon Marchi In-Reply-To: <20260225-target-fd-newtype-v1-1-e04af6692ccb@adacore.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 On 2/25/26 4:25 PM, Tom Tromey wrote: > @@ -3251,25 +3251,27 @@ target_fileio_open (struct inferior *inf, const char *filename, > if (fd == -1 && *target_errno == FILEIO_ENOSYS) > continue; > > + remote_fd result; > if (fd < 0) > - fd = -1; > + result = remote_fd::INVALID; > else > - fd = acquire_fileio_fd (t, fd); > + result = acquire_fileio_fd (t, fd); > > target_debug_printf_nofunc ("target_fileio_open (%d,%s,0x%x,0%o,%d) = %d (%d)", > - inf == NULL ? 0 : inf->num, filename, flags, mode, > - warn_if_slow, fd, fd != -1 ? 0 : *target_errno); > - return fd; > + inf == NULL ? 0 : inf->num, filename, > + flags, mode, warn_if_slow, int (fd), > + int (fd) != -1 ? 0 : *target_errno); > + return result; One more nit: in this function, you don't need to case fd to int, since fd is an int. You could either remove the cast, or use `result` in the debug print. Simon