From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id ee5FFxdpn2lfNgoAWB0awg (envelope-from ) for ; Wed, 25 Feb 2026 16:26:47 -0500 Authentication-Results: simark.ca; dkim=pass (2048-bit key; secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=kPHXFzUs; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 590E11E0DD; Wed, 25 Feb 2026 16:26:47 -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 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 BE9D41E08D for ; Wed, 25 Feb 2026 16:26:45 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 7FBB24BA23E6 for ; Wed, 25 Feb 2026 21:26:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7FBB24BA23E6 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, secure) header.d=adacore.com header.i=@adacore.com header.a=rsa-sha256 header.s=google header.b=kPHXFzUs Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) by sourceware.org (Postfix) with ESMTPS id 1FAA84BA2E13 for ; Wed, 25 Feb 2026 21:25:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1FAA84BA2E13 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1FAA84BA2E13 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::332 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1772054753; cv=none; b=tZcTgvgThCZNdDkzEmu06zOzE0JowSmczF+b++SxtlLVQAlIuImrnWRTikXpY9WAmR4QzuqBZ/nCdUla/BBzXQ1lNjv85YuwS4cdKZLG13p9qnimSDChVYnxwFaXcrVKI81rju7h7+jTEdwd4i/lrTNEbQWFt3b1l08OxBYT0Lo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1772054753; c=relaxed/simple; bh=AUB7ig7zBJL//uKIrfY49T02cNIVJuvw0ZJgTLbC6SY=; h=DKIM-Signature:From:Subject:Date:Message-Id:MIME-Version:To; b=oOvbB3J3rZ7fX4mIL4GcO8LTYsMSOHW2OE5wMHn6yDYW9WbBXxEMeSG+tqmX0SV/QsRxuBtbtCSSuONr74Cyg22MzOmDd8gqbjCHJOiQhWqMEm+cVN7PX5BcwEVK0gkmwCrUDLfM+a1/GUgkkEUbkbQd7Q9U4PGrMN2QOTitzRk= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1FAA84BA2E13 Received: by mail-ot1-x332.google.com with SMTP id 46e09a7af769-7d4beaf25deso1068385a34.0 for ; Wed, 25 Feb 2026 13:25:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1772054752; x=1772659552; darn=sourceware.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=ihAgSMuTAHaL6hx9lMTJsGkrG5Rqy2Mkh3mAAGelWFA=; b=kPHXFzUsleFj2bpHMrfPAAZDI9hNIzqFqCc3ZSt167+Ybzzzb3Z/ampmg2xmy0BZmD L2XRj+ZoYTS0DyxJhKe8HxEeAA/E0O2aSAPEKgHDSheNxpimEc28JnM9ZBpwq4pstQ8F l++9TEbrFQgftMUznNIhLBD6u1TEEjUK5zCbZHG0/VDhIIlyv1AqvEiX/uNCgsxAr3xa 3TKyd0rK7ypzdmz/O8068amNXDbEJ9NEX9akpQjl19PMdZAGkZaoN3IgBKsvM8yIun8v 4prlcomwobuYJWB8SiO4y0hHc94QcGD7bokKXCSZqg72wmye73gdCNrmtb1kT5zgUuIE mNyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772054752; x=1772659552; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ihAgSMuTAHaL6hx9lMTJsGkrG5Rqy2Mkh3mAAGelWFA=; b=j2+duqBPVISKSB7GOrPrbXXh6ho54Vdgy2mpdDUyUs0Vq0WNiEgZmdXeb6PEBgECS+ c9UX2YVtlMYq/HvQ9Fu747rv5fTSb1z1c0jqnv+e+p2vKEr12KGTNGiAJ246gFpGVHU8 I372dnfEpwJIyZSaFHwk0AKsdmIkGMXUxQgoOy6si+BTB7nv1d/oto6MLHya4Y/fPsdT gh72QheoBUSym1eQDgZZ4lpYBKM5JbMcYzBppuWOSze6/ZNWK8loLYpVAhe0MGEMGUPx mInhjR1McohYRpVv+jHrFFIQ0oItKXjPClRBzaDLpA+Le/4r4VNozRJQm4TgCBjlIIYL 4qlA== X-Gm-Message-State: AOJu0YyHsdXRfKmH/5B2oqp90D8OJhbMHjwLaV5SQqQ+aDxZmsx4axfB 71JphK14MNvP90Sp90OuqVOZO61jfs6M965bddwrqXYDYnB1nLbWXUweQJV+L33JyzCVL7NWlTs Xx7M= X-Gm-Gg: ATEYQzwD8OVen2Hzkg0jO3jr2hNEjy24b2TeyyoAU6hwrh8Iu8cUdTEClJtFRX5FF8C WwzVBDEYS2/pmJNpOD8dVXw0oWSJUZFKfI8Zgd97J22ZN3aHdKASKQOO1lAvNsc5sgqgiiN4njv ZNjGU0GtQ5jHg2l44I11D6xIgVb5kNamenKiEaHeNKNSFDAF8B4SfmikqEw2cQGBsGb+cE8ZCRC xE4GW80veJcZk6oB4xq3tUmOedFeYduRKmXITAiH7RNSayqeUP4u6vPyMjb4Hp7c1QZU+yoeCs2 zW/hTgk+YhAe3Qyx0IO1EoRwb7gxyeOAPp5GmtqEkn8+9kA5NfQKeEgotT3x9VY4hHuKP5ZjRlO Kh+pns6GRedo4FVbXb0dHftzQQgWd82TqskguOEx6IpLo7cqCtCjT5jXx3XiDYBDfh/nAoCn8qh 8njfQYDver/GSSPRxistqNUZk6uOP8qC1/Jn8hTyiS7ov0FOpc4XproPWS X-Received: by 2002:a05:6870:8a0e:b0:40e:e3f6:bc9a with SMTP id 586e51a60fabf-41609d5ff43mr347784fac.9.1772054752360; Wed, 25 Feb 2026 13:25:52 -0800 (PST) Received: from [192.168.0.26] (97-122-122-234.hlrn.qwest.net. [97.122.122.234]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-4160d26d9absm44144fac.16.2026.02.25.13.25.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Feb 2026 13:25:52 -0800 (PST) From: Tom Tromey Subject: [PATCH 0/2] Stronger typing for remote file i/o Date: Wed, 25 Feb 2026 14:25:50 -0700 Message-Id: <20260225-target-fd-newtype-v1-0-e04af6692ccb@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAAAAAAAC/x3MQQrCMBCF4auUWTvYJlTBq4iLSTJNZ2FaJqEqp Xd3dPnBe/8OlVW4wq3bQXmTKksxDKcO4kwlM0oyg+vdpXduxEaaueGUsPCrfVbGMEbPnpIfwhX stypP8v437w9zoGojpRLnX2lRyVLOT6qNFY7jCxd59XiDAAAA X-Change-ID: 20260225-target-fd-newtype-b5c3e3ad31b7 To: gdb-patches@sourceware.org Cc: Tom Tromey X-Mailer: b4 0.14.3 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 This short series adds stronger typing to the remote file i/o APIs, by replacing some integers with enums. This prevents mixing host and remote-protocol values, and also differentiates between host and remote file descriptors. Regression tested on x86-64 Fedora 43. Note I could not test the solib-rocm.c changes. These are best effort. Signed-off-by: Tom Tromey --- Tom Tromey (2): Use a newtype for remote file descriptor Use enum types for remote fileio flags gdb/gdb_bfd.c | 8 ++--- gdb/inf-child.c | 4 +-- gdb/inf-child.h | 4 +-- gdb/linux-nat.c | 4 +-- gdb/linux-nat.h | 4 +-- gdb/remote-fileio.c | 91 +++++++++------------------------------------------- gdb/remote.c | 19 ++++++----- gdb/solib-rocm.c | 30 ++++++++--------- gdb/sparc64-tdep.c | 23 ++++++------- gdb/target.c | 76 +++++++++++++++++++++++-------------------- gdb/target.h | 32 +++++++++++------- gdbserver/hostio.cc | 4 +-- gdbsupport/fileio.cc | 20 ++++++------ gdbsupport/fileio.h | 81 ++++++++++++++++++++++++++-------------------- 14 files changed, 186 insertions(+), 214 deletions(-) --- base-commit: adbc0c55421dd5e31bb1903512dfb8f5211ee5b0 change-id: 20260225-target-fd-newtype-b5c3e3ad31b7 Best regards, -- Tom Tromey