From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 1Xb8CD16YWiqdiUAWB0awg (envelope-from ) for ; Sun, 29 Jun 2025 13:39:09 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=yahoo.de header.i=@yahoo.de header.a=rsa-sha256 header.s=s2048 header.b=E8+4aaGw; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 0CE231E11E; Sun, 29 Jun 2025 13:39:09 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-9.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE autolearn=ham autolearn_force=no version=4.0.1 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 F12291E0C2 for ; Sun, 29 Jun 2025 13:39:06 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 75B1B3852FF7 for ; Sun, 29 Jun 2025 17:39:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 75B1B3852FF7 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=yahoo.de header.i=@yahoo.de header.a=rsa-sha256 header.s=s2048 header.b=E8+4aaGw Received: from sonic310-11.consmr.mail.ir2.yahoo.com (sonic310-11.consmr.mail.ir2.yahoo.com [77.238.177.32]) by sourceware.org (Postfix) with ESMTPS id DB78B385E825 for ; Sun, 29 Jun 2025 17:38:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DB78B385E825 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=yahoo.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=yahoo.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DB78B385E825 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=77.238.177.32 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1751218716; cv=none; b=BzXaIDBI+ysyFFjHeOs9FoemEfK6gkye8hdSjvGp6cgC6niY0UwO1tM27mQ8NVsiC7zb4FTHV+zGcRT2WfS+1sOIjT/WvbuXTIMJTIGygCd8yTmx88o/GgZAqa7WLt++MPkYsJm/9Sh7JmGLGZG1xXIEHJwDfAPZEZyX7FN3rhE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1751218716; c=relaxed/simple; bh=C/D4zofs2V2R/dxyTe7krXTi1DAoYkty10iUJmFFJtk=; h=DKIM-Signature:Date:From:To:Message-ID:Subject:MIME-Version; b=Cj1x6F/MKKPGlgKG30mKh2Mxs8TrxsEhYFHi4ikOdLstP5IrNclRBPrtYgOq9OuFRFYGg48hOAT+JBQFxP1MYyKVwpzj0OIckvoFisOgt8e8qfyHRcDwEsvAYNcTHVDcJ0FsILuJSGgTQPxwPKXsnJOZg/+2sy67LoN7YuAt1jY= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DB78B385E825 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s2048; t=1751218714; bh=C/D4zofs2V2R/dxyTe7krXTi1DAoYkty10iUJmFFJtk=; h=Date:From:To:In-Reply-To:References:Subject:From:Subject:Reply-To; b=E8+4aaGwLkM6tiJC7IQdAmULjgCkXQtIC7gl4VPTfHTosjPAVBYhbCi6NAHP9MHi/6hu5vLLkJigWZJGi69MmKBGM7jlRwNqULo8g3KNmYNpYHIKb+sAe875krkU0x1UPtmyYxH9ShNrBkSgQqzkB71UvFvxXHthPZQTqVmIox2uW4ObZ7IN2CX3BoxawcHs56Kf1z6clCOzQoWX7wI2yKGFSCBC3t4z8QyT2kpVPM/m7sOqz/jGabalCSwHvMp2xou0HKeJnLY3lL3060Qf2F3R0HOdM7Z6/ktBpbBhzItcHM/5/huL4cNqhjo8jng7xGIyQNnL/waC0l3E0t1OhA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1751218714; bh=KxX+i/fdjH50jgmEI0vA9s+6MJZN+wsPoGMFyRZYy3u=; h=X-Sonic-MF:Date:From:To:Subject:From:Subject; b=qHmenFx89pRmPO0KURKgT6Ari6BFnOS0tpMhsQvBMfjhJEdHylVF9XcQhn4MIbUoTq3zpn21jWOCraONQfCrKQMcAMj99VG9QcENeYm/XHnWXK7Jf337A0Pll6XcbnaJVGW9dm0v66ZYXF6MRaXl4hoaczMiVBEdyGHNOslGhvhIKaRHuF2V1+Dg7q+22+eoKtSZZTmTuWM4IrBenAoKL/haaulQpNUtsXxLetEhi02d93GC3Nd5r1d+YscE9rb7wWLwqjpkTpgN+a75MFtgddQ8q5yMH2UPWd7Ij+9H3pBYbHNAOvZK1tVvOMGoSqw6O3RhwY0nx4pXTWV5FtAF2w== X-YMail-OSG: 2Ny9c_QVM1kw.I3OYyD161ny5Uu1VBYyYiCR.75ECEZz0bsuHettrJYDDzx_gDw 0Fb2SVfPXG8uvY49dkHriiZ75Sp4263Mda7YR.6IgZSs88IrkHu0oXWl6jYOtfsqJzspkfV8pYUK pqLkIJMJfDJHMGpi7S2nDsx7ym3g3tD0nof5LzgPT9tG_PZ6VhojP2yGt35I7nSdHL9NZPeI1IOx arrshCbly4mPOLRI_12JPrm2JEYwXXTTXJTkcJPHCzX9B62Lf4XDRcw3CPTR8BGxOwtfK8D4SEVR PMUHfKXaujUDu9ksKERc2X1NtN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 2025 17:38:34 +0000 Date: Sun, 29 Jun 2025 17:38:32 +0000 (UTC) From: Hannes Domani To: "gdb-patches@sourceware.org" , Pedro Alves Message-ID: <1300261172.1158331.1751218712472@mail.yahoo.com> In-Reply-To: <81ba0310-7b26-43e5-8770-1c2dba9f73f3@palves.net> References: <1549974991.1116105.1750000125453.ref@mail.yahoo.com> <1549974991.1116105.1750000125453@mail.yahoo.com> <81ba0310-7b26-43e5-8770-1c2dba9f73f3@palves.net> Subject: Re: [PATCH] Improve attach on Windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Mailer: WebService/1.1.24076 YMailNorrin 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 Am Mittwoch, 25. Juni 2025 um 15:32:00 MESZ hat Pedro Alves Folgendes geschrieben: > Hi Hannes, > > [Guess the list was dropped by mistake, adding it back.] > > On 2025-06-15 16:08, Hannes Domani wrote: > >> Automatically switching to main thread is IMHO more useful.=C2=A0 That > >> results in very similar output than what we see on Linux: > >> > >> attach 5164 > >> Attaching to program: /home/alves/gdb/build-cygwin-testsuite/outputs/g= db.base/attach/attach, process 5164 > >> [New Thread 5164.0x87c] > >> [New Thread 5164.0x28f0] > >> [New Thread 5164.0x376c] > >> [New Thread 5164.0x2db4] > >> [New Thread 5164.0xce4] > >> main () at /home/alves/gdb/src/gdb/testsuite/gdb.base/attach.c:19 > >> 19=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 while (! should_exit) > >> (gdb) > > > > I wonder if we should do something similar when Ctrl-C is hit. > > > > That could be done, I guess.=C2=A0 I can think of one downside, but I'm n= ot sure > it's strong enough.=C2=A0 If you're debugging a program that has a Ctrl-C= handler installed, > and you decide to pass the exception to the program, after GDB intercepte= d it, you can do > it immediately with "signal SIGINT", or "queue-signal SIGINT; c".=C2=A0 B= ut if GDB automatically > changes threads, then you have to remember to switch to the thread that g= ot the exception, > before issuing the "signal" command.=C2=A0 Maybe that could be sorted out= with a warning.=C2=A0 But > then it might be annoying to see the warning all the time. Why would you have to switch threads before "signal", when the signal is anyways handled in a new thread? > BTW, in the users/palves/windows-non-stop-v2-plus branch, you'll find som= e extra patches, and this one: > > commit 95bafb7217bac2d51f5b6a59d34d79bcbaa1eddc > Author:=C2=A0=C2=A0=C2=A0 Pedro Alves > AuthorDate: Fri May 5 15:51:31 2023 +0100 > Commit:=C2=A0=C2=A0=C2=A0 Pedro Alves > CommitDate: Mon Jun 9 18:49:19 2025 +0100 > >=C2=A0=C2=A0=C2=A0=C2=A0 Windows all-stop, interrupt with "stopped" instea= d of SIGTRAP > > ... is sort of related.=C2=A0 It doesn't affect pressing Ctrl-C, but it a= ffects explicit > "interrupt", like: > > (gdb) c& > Continuing. > (gdb) [New Thread 11688.0x2ff8] > [Thread 11688.0x2e30 exited with code 0] > [New Thread 11688.0x3040] > interrupt > > (gdb) > Thread 1 "sleep" stopped. > [Switching to Thread 11688.0x2e94] > 0x00007ffd839118d7 in ntdll!ZwWaitForMultipleObjects () from /cygdrive/c/= Windows/SYSTEM32/ntdll.dll > > > For Ctrl-C, it might be possible to make GDB see the Ctrl-C before the in= ferior does, and then stop > the inferior with "stopped" too (i.e., just suspend threads, no exception= injected.).=C2=A0 I still have > the Ctrl-C rework series that makes Linux work that way (by making the in= ferior transparently run on > a separate pseudo tty) that I hope I'll eventually be able to get back to= .=C2=A0 Not sure Windows would need > a similar treatment, though, but it might. I'm using your Ctrl-C rework series on Linux for years now, and am always wondering why it wasn't merged yet. As for a similar treatment on Windows, I guess this would be possible since Win10, but only needed if "new-console off" (I always use "new-console on")= . Hannes