From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id QN16FwgrT2cIvAIAWB0awg (envelope-from ) for ; Tue, 03 Dec 2024 11:00:08 -0500 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=default header.b=Ol3p8AN9; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 5CE411E0BB; Tue, 3 Dec 2024 11:00:08 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.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 autolearn=unavailable autolearn_force=no version=4.0.0 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 EE9A31E092 for ; Tue, 3 Dec 2024 11:00:07 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9CB623858414 for ; Tue, 3 Dec 2024 16:00:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9CB623858414 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=default header.b=Ol3p8AN9 Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 086693858D26 for ; Tue, 3 Dec 2024 15:58:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 086693858D26 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=polymtl.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 086693858D26 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=132.207.4.11 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1733241506; cv=none; b=J5W0/5aXcuDp/KXzTub89eJsJCzoe+/oVPPtLx3TRqzsfqo3sCSd5s3QS7o6HLPwKjqzgXudMxx0+BWxLqt4342bi0JtIrpad5SNwk3f4GFMd7vyhwAQSz9NH0+TGo35FRNnqMhFt0pdy6PITAe6c+9nJXjAqXQArG1lUjTy0VE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1733241506; c=relaxed/simple; bh=0pLjDbESelZJaCwpM6M2ZKe6dhHK1W0suLHKzewi5+0=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=EF+R7vQpX0LeFqNeDE4NfyV4WxA0D9jvSuvwqGWwKRDPZj0PqJb4R5dGQ9nYSC63fcIzrQ0YicZuRmLe1YoBCUmPllwVkx3ApE9gi9wh+yYQKFPqLezYCeaQFZnWU6Ra8rGcu9Sf0T7RWI5Yq94McyJvkFDI66JHtFd+JhqtRAc= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 086693858D26 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 4B3FwKX4127386 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 3 Dec 2024 10:58:25 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 4B3FwKX4127386 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1733241505; bh=XY5NAM7pmHeQDhYXLHz9ltAIOjyqKGM/glqRV4dYAXY=; h=Date:Subject:To:From:In-Reply-To:From; b=Ol3p8AN9BPvXnjzr4mOqKUIOdR3EliRHVxw8LoF46AYO1thdezxBnX2gj3qrPc7pi gJ7xXh7jTXZrlyxR1NuN4itPlhNI+jEm2K1h6a+Qgdw4jzuaIHNIFoKZ9PFnpei22v Yn3MXaaIUQYwVqYw2m3eT7hRrjDpdzqboGaFf40s= Received: by simark.ca (Postfix, from userid 112) id 86E6A1E0C0; Tue, 3 Dec 2024 10:58:20 -0500 (EST) Received: from [192.168.191.187] (unknown [204.48.79.192]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 51D0B1E092; Tue, 3 Dec 2024 10:58:19 -0500 (EST) Message-ID: Date: Tue, 3 Dec 2024 10:58:18 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] gdbserver/win32-low.cc: remove use of `all_threads` To: Hannes Domani , "gdb-patches@sourceware.org" References: <20241202194722.1297596-1-simon.marchi@polymtl.ca> <1118788268.7833323.1733236497630@mail.yahoo.com> Content-Language: fr From: Simon Marchi In-Reply-To: <1118788268.7833323.1733236497630@mail.yahoo.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Tue, 3 Dec 2024 15:58:20 +0000 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 12/3/24 9:34 AM, Hannes Domani wrote: > Am Montag, 2. Dezember 2024 um 20:50:34 MEZ hat Simon Marchi Folgendes geschrieben: > >> Fix this: >> >> /home/simark/src/binutils-gdb/gdbserver/win32-low.cc: In function ‘void child_delete_thread(DWORD, DWORD)’: >> /home/simark/src/binutils-gdb/gdbserver/win32-low.cc:192:7: error: ‘all_threads’ was not declared in this scope; did you mean ‘using_threads’? >> 192 | if (all_threads.size () == 1) >> | ^~~~~~~~~~~ >> | using_threads >> >> Commit 9f77b3aa0bfc ("gdbserver: change 'all_processes' and >> 'all_threads' list type") changed the type of `all_thread` to an >> intrusive_list, without changing this particular use, which broke the >> build because an intrusive_list doesn't know its size (we, could, >> Boost's version has an option for that, but we don't need it at the >> moment). The subsequent commit removed `all_threads`, leading to the >> error above. >> >> Fix it by using the number of threads of the current process instead. >> My rationale: as far as I know, GDBserver on Windows only supports one >> process at a time, so there's no need to iterate over all processes. It >> would be nice if someone familiar with the Windows port could confirm >> (and test) this. > > I tested it now, and there seems to be no problem. > > But this if() actually never triggered for me, I never got an > EXIT_THREAD_DEBUG_EVENT for the final thread, only an > EXIT_PROCESS_DEBUG_EVENT. > I tried it out on both Win7 and Win11, but maybe there is some special > constellation where this can happen, or it was different on earlier > Windows versions. Damn, I hoped you would know. The comment is somewhat useless, it just literally explains what the code does, much like: /* Add 1 and 2 together and assign to x. */ x = 1 + 2; > Tested-By: Hannes Domani Thanks for testing, bug I will send a v2 implementing Stephan's suggestion. It's a minor change, but better be safe than sorry. Simon