From: Simon Marchi <simark@simark.ca>
To: Tom Tromey <tromey@adacore.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 3/3] Introduce gdbsupport/cxx-thread.h and use it
Date: Wed, 1 Oct 2025 16:16:47 -0400 [thread overview]
Message-ID: <dfea84c3-7560-4d1b-a78a-db846c9fd333@simark.ca> (raw)
In-Reply-To: <20251001-isolate-cxx-thread-v1-3-4bb740be2467@adacore.com>
On 10/1/25 2:57 PM, Tom Tromey wrote:
> This introduces a new file, gdbsupport/cxx-thread.h, which provides
> stubs for the C++ threading functionality on systems that don't
> support it.
>
> On fully-working ports, this header just supplies a number of aliases
> in the gdb namespace. So, for instance, gdb::mutex is just an alias
> for std::mutex.
>
> For non-working ports, compatibility stubs are provided for the subset
> of threading functionality that's used in gdb. These generally do
> nothing and assume single-threaded operation.
>
> The idea behind this is to reduce the number of checks of
> CXX_STD_THREAD, making the code cleaner.
>
> Not all spots using CXX_STD_THREAD could readily be converted.
> In particular:
>
> * Unit tests
> * --config output
> * Code manipulating threads themselves
> * The extension interrupting handling code
>
> These all seem fine to me.
>
> Note there's also a check in py-dap.c. This one is perhaps slightly
> subtle: DAP starts threads on the Python side, but it relies on gdb
> itself being thread-savvy, for instance in gdb.post_event.
I think this looks good. The remaining uses of CXX_STD_THREAD appear to
be in areas we don't touch often. I like that we no longer need to wrap
all uses of std::mutex:w
Did you get a chance to validate your change on one of those toolchains
that don't have std::thread support?
Approved-By: Simon Marchi <simon.marchi@efficios.com>
Simon
next prev parent reply other threads:[~2025-10-01 20:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-01 18:57 [PATCH 0/3] Add compatibility definitions for C++ thread support Tom Tromey
2025-10-01 18:57 ` [PATCH 1/3] Remove an unused include Tom Tromey
2025-10-01 20:04 ` Simon Marchi
2025-10-02 12:59 ` Tom Tromey
2025-10-01 18:57 ` [PATCH 2/3] Don't rely on deduction in run-on-main-thread.c Tom Tromey
2025-10-01 18:57 ` [PATCH 3/3] Introduce gdbsupport/cxx-thread.h and use it Tom Tromey
2025-10-01 20:16 ` Simon Marchi [this message]
2025-10-02 16:58 ` Tom Tromey
2025-10-02 18:09 ` 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=dfea84c3-7560-4d1b-a78a-db846c9fd333@simark.ca \
--to=simark@simark.ca \
--cc=gdb-patches@sourceware.org \
--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