From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id T7x2Ik6M3WikpBsAWB0awg (envelope-from ) for ; Wed, 01 Oct 2025 16:17:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1759349838; bh=JgS4NwIIixU/d6ALAfKteRFhwIj2q3ZDH1YXBOH88bI=; h=Date:Subject:To:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=eoFzgv5QLaIhuwjlefhwQu3VV2Hkk3GN6UZLx7qzPebJPXEtngzcGJUXVUg/F5z+Z jInVrY5mFu92LDaYSk9Lbs7v4lKraAyEFosGUWp8EYJOtgcUp7WSLFg58AaVcYuL3V pXuueDK1VZsIH5bvBNX3AGk7Dz4zHD9663ogTRbI= Received: by simark.ca (Postfix, from userid 112) id 7D1441E04C; Wed, 01 Oct 2025 16:17:18 -0400 (EDT) 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=VqkxGpL9; dkim-atps=neutral Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (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 13ABA1E04C for ; Wed, 01 Oct 2025 16:17:18 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B04633858C24 for ; Wed, 1 Oct 2025 20:17:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B04633858C24 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=VqkxGpL9 Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id D6B883858D20 for ; Wed, 1 Oct 2025 20:16:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D6B883858D20 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 D6B883858D20 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=1759349808; cv=none; b=Qedq5jfpcqyM5ShCfJy9dNn5ZfBitYbq7AJ5kqgV6oQxaYsnJCHmJwsJsES/hv+k14/1z4qXCuuyoCUbmw+8UOA2Fx86E52Qk80UZPsy4jKc9ak8qcfpAysk+55XvJOiprFf/Gvujj+5F7GPW2dB+Ek97ACqkSP8XXPdrifOSwg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1759349808; c=relaxed/simple; bh=JgS4NwIIixU/d6ALAfKteRFhwIj2q3ZDH1YXBOH88bI=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=Lekt61weBdmcyfuBlWynI+1Tk9HfYTSyeO7LeKz2HQdJgPLhP3y/qq5zzmtqhbF4knaohRZ/ZouudD1gGA2JZDd7NIaaV49s4Y2TeCU5C/R7RSPmCEUZLWXq0dZj8JVW6agVf2RwSQe+RAIN5FyJQESA49EljdEzaMsqPVlq1+E= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D6B883858D20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1759349808; bh=JgS4NwIIixU/d6ALAfKteRFhwIj2q3ZDH1YXBOH88bI=; h=Date:Subject:To:References:From:In-Reply-To:From; b=VqkxGpL9TcHN7ZSrOiIjCmVcIATJ2foDtVLCIxCQjZnwcZFTH5p0iYQ3JzUFyyjhy PbPx0P8LYL8n2YwElpDyvX/utWu155HMI5dWS1JMBXCJls4tvDS+qptwguLOKBk1Mc kBsSS9YE1LTzLdmyc461byi0R5geJDlHKNJ4uLHU= Received: by simark.ca (Postfix) id 5C4961E04C; Wed, 01 Oct 2025 16:16:48 -0400 (EDT) Message-ID: Date: Wed, 1 Oct 2025 16:16:47 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/3] Introduce gdbsupport/cxx-thread.h and use it To: Tom Tromey , gdb-patches@sourceware.org References: <20251001-isolate-cxx-thread-v1-0-4bb740be2467@adacore.com> <20251001-isolate-cxx-thread-v1-3-4bb740be2467@adacore.com> From: Simon Marchi Content-Language: fr In-Reply-To: <20251001-isolate-cxx-thread-v1-3-4bb740be2467@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 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