From: Simon Marchi <simark@simark.ca>
To: Tom Tromey <tromey@adacore.com>, gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@efficios.com>
Subject: Re: [PATCH v2 1/3] Use a newtype for remote file descriptor
Date: Fri, 27 Feb 2026 11:30:27 -0500 [thread overview]
Message-ID: <efe4d337-e37d-4c1e-9c65-1f85909fcb7d@simark.ca> (raw)
In-Reply-To: <20260227-target-fd-newtype-v2-1-7a266666ae36@adacore.com>
On 2/27/26 9:28 AM, Tom Tromey wrote:
> I was digging through the remote fd code and got a little confused at
> some point about what kind of fd was used where.
>
> It seemed better to me to avoid any confusion by making the remote
> file descriptor a newtype, i.e., incompatible with 'int'.
>
> I limited the change to the "public" API. That is, I let the file
> descriptor as used by the actual target implementation methods remain
> "int".
>
> This found one bug, namely that sparc64-tdep.c assumed that 0 was an
> invalid value for a target fd.
With this patch, we now have 2 different classes names scoped_target_fd.
Is it a problem, ODR-wise? It looks like they have the same goal, so we
could perhaps merge them.
Simon
next prev parent reply other threads:[~2026-02-27 16:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-27 14:28 [PATCH v2 0/3] Stronger typing for remote file i/o Tom Tromey
2026-02-27 14:28 ` [PATCH v2 1/3] Use a newtype for remote file descriptor Tom Tromey
2026-02-27 16:30 ` Simon Marchi [this message]
2026-02-27 18:17 ` Tom Tromey
2026-02-27 18:22 ` Tom Tromey
2026-02-27 14:28 ` [PATCH v2 2/3] Use enum types for remote fileio flags Tom Tromey
2026-02-27 14:28 ` [PATCH v2 3/3] Use bool for "warn_if_slow" Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=efe4d337-e37d-4c1e-9c65-1f85909fcb7d@simark.ca \
--to=simark@simark.ca \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@efficios.com \
--cc=tromey@adacore.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox