From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29410 invoked by alias); 10 May 2008 04:34:38 -0000 Received: (qmail 29402 invoked by uid 22791); 10 May 2008 04:34:37 -0000 X-Spam-Check-By: sourceware.org Received: from pool-72-74-94-32.bstnma.fios.verizon.net (HELO ednor.cgf.cx) (72.74.94.32) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 10 May 2008 04:34:15 +0000 Received: by ednor.cgf.cx (Postfix, from userid 201) id 09BC061E7; Sat, 10 May 2008 00:34:14 -0400 (EDT) Date: Sat, 10 May 2008 15:31:00 -0000 From: Christopher Faylor To: gdb-patches@sourceware.org, Joel Brobecker Subject: Re: [RFC] control-c handling on Windows... Message-ID: <20080510043413.GA5429@ednor.casa.cgf.cx> Mail-Followup-To: gdb-patches@sourceware.org, Joel Brobecker References: <20080507205611.GB7421@adacore.com> <20080509202942.GA4386@ednor.casa.cgf.cx> <20080510013336.GC28890@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080510013336.GC28890@adacore.com> User-Agent: Mutt/1.5.16 (2007-06-09) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-05/txt/msg00335.txt.bz2 On Fri, May 09, 2008 at 06:33:37PM -0700, Joel Brobecker wrote: >> But, if your patch fixes the problem I'm ok with checking it in. > >I think that this is probably the easiest to solve all problems. >Here is the same patch, but with a comment explaining why we temporarily >ignore SIGINT... > >2008-05-10 Joel Brobecker > > * win32-nat.c (win32_wait): Ignore SIGINT while waiting for > a debug event. > >I thought you might have some comments/suggestions on the comment, >so I'll wait for your OK before checking it in. I don't think the comment is right. I think it is expected behavior that both gdb and the inferior should see the CTRL-C since they are both associated with the same console. I don't know this for sure because Windows concept of process groups are sort of a mystery to me. I think the way this is handled in linux is by resetting the controlling process group of the terminal to the pid of the inferior. On thinking about this more, I think it probably makes more sense to bracket the call with: SetConsoleCtrlHandler (NULL, TRUE); retval = get_win32_debug_event (pid, ourstatus); SetConsoleCtrlHandler (NULL, FALSE); That's almost equivalent to what linux does with process groups I think. Does the above work in your scenario, Joel? If so, I think this is safe to check in. cgf