From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id tY3xNviK32nQTBkAWB0awg (envelope-from ) for ; Wed, 15 Apr 2026 08:56:24 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=monnerat.net header.i=@monnerat.net header.a=rsa-sha256 header.s=mnet header.b=pGFPjTZo; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 8EBDE1E0B1; Wed, 15 Apr 2026 08:56:24 -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 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 614801E0B1 for ; Wed, 15 Apr 2026 08:56:22 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id B96A04BA2E3C for ; Wed, 15 Apr 2026 12:56:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B96A04BA2E3C Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=monnerat.net header.i=@monnerat.net header.a=rsa-sha256 header.s=mnet header.b=pGFPjTZo Received: from jupiter.monnerat.net (jupiter.monnerat.net [46.226.111.226]) by sourceware.org (Postfix) with ESMTPS id 9E1884BA2E07 for ; Wed, 15 Apr 2026 12:55:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9E1884BA2E07 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=monnerat.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=monnerat.net ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9E1884BA2E07 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=46.226.111.226 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776257757; cv=none; b=nRPi0b05M+mtnIsBCOmKVyw85JFfEzgLC6BPiXkYGdM0LoJZz8rcLpH0afeH5ha8j9iObzVbAzDOeNeneRlNi/gqWoEAeKAndjhPlPDYD0mHO8IwCveUSw9Ua2+xQLxc6Zj0EMKFGv2jgCOlYWclP1a3MysFUkg19N8trgRKyg0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776257757; c=relaxed/simple; bh=cZUavG1nhvkWNfVBPf464dDOkHTuzD7ztfkN0YfcH/0=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=cknE+jrzhEOmdcRVbZ0woWgLQsMsyLqU1Q8WhuNdgTKtmRSJcy0Z0zHD7DXUqYtJ6ZKYDCQdzIG0dKfRl91305mnIcbhztt8vFkAxLXcJhYJ4IXlGwt+fFqO2OHsLSyqpGzTBiyF2p/XueO5Yra5AgE1sN9gr4esbFswsJaCksA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9E1884BA2E07 Received: from [192.168.0.128] ([192.168.0.128]) by jupiter.monnerat.net (8.14.8/8.14.8) with ESMTP id 63FCtl0C020706 (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256 verify=OK); Wed, 15 Apr 2026 14:55:53 +0200 DKIM-Filter: OpenDKIM Filter v2.10.3 jupiter.monnerat.net 63FCtl0C020706 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=monnerat.net; s=mnet; t=1776257753; bh=cZUavG1nhvkWNfVBPf464dDOkHTuzD7ztfkN0YfcH/0=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=pGFPjTZo7wf12LdOraQ9tKNTLmZpqWwJEdEFt5inaXujWeUgBtTDrkGz8PFZ0E+3i B+Tou/id0gcBbt7FSt/cMfhr3Kkt8Lo9gOZOrWVk5gYLcvDPmm9/fZECFKNAosGAgz 6mXmSxI8L7pz6pLvxV+hW0AW5/QvFWNQTkq/lRq4= Message-ID: Date: Wed, 15 Apr 2026 14:55:47 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] Implement windows_nat_target::stop To: Tom Tromey Cc: gdb-patches@sourceware.org References: <20260411143242.143320-2-patrick@monnerat.net> <874ildwnky.fsf@tromey.com> Content-Language: en-US From: Patrick Monnerat In-Reply-To: <874ildwnky.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 4/14/26 5:47 PM, Tom Tromey wrote: > Patrick> Insight makes a difference between hitting Ctrl-C (that triggers > Patrick> target::pass_ctrlc) and clicking the GUI stop button, triggering > Patrick> target::stop). > > I wonder why. I can't tell you exactly: the use of target_stop() has been introduced in 1994 without detailed explanation! As a pure conjecture for the initial motivation, I can imagine: - the target program may have no associated console thus may use SIGINT for another purpose - Bare gdb has only a console interface, so it borrows SIGINT for stopping the target: a gui can do better (!). Latest reworks of this are dated around 1997-1999. Maybe this should be modernized. > > Also I see Insight calls target_stop and not target_stop_and_wait, which > seems a bit weird. Yes, you're right. target_stop_and_wait() introduction (2014) is posterior to target_stop() and missed from insight point of view. This is a perverse effect of having splitted out insight: not many gdb developers dive into its code nowadays. In all cases, a target_stop_and_wait() call ends in target_stop(), so this change, although wise, would not fix the current problem. > > Patrick> As windows_nat did not implement the stop method, the GUI stop button > Patrick> was inoperant on Windows. > > Patrick> +void > Patrick> +windows_nat_target::stop (ptid_t ptid) > Patrick> +{ > Patrick> + interrupt (); > Patrick> +} > > I don't really know the contract here but is interrupt guaranteed to > stop PTID? Like is the relevant inferior always selected? How does > this interact with non-stop? ? Really out of my skills, sorry. > > Right now it's probably somewhat moot but there's ongoing work for > non-stop and multi-inferior on Windows. > So you mean I should wait for this work to land and steady ? In all cases, it should provide a target stop method compatible with other targets. Thanks for your review, Patrick