From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31695 invoked by alias); 21 Jun 2008 17:05:41 -0000 Received: (qmail 31687 invoked by uid 22791); 21 Jun 2008 17:05:41 -0000 X-Spam-Check-By: sourceware.org Received: from pool-71-248-179-123.bstnma.fios.verizon.net (HELO ednor.cgf.cx) (71.248.179.123) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 21 Jun 2008 17:05:23 +0000 Received: by ednor.cgf.cx (Postfix, from userid 201) id D5B7D608C60; Sat, 21 Jun 2008 13:05:21 -0400 (EDT) Date: Sat, 21 Jun 2008 18:37:00 -0000 From: Christopher Faylor To: gdb-patches@sourceware.org, Pierre Muller Subject: Re: [RFC] win32-nat.c 'set new-console' and interruption Message-ID: <20080621170521.GB2470@ednor.casa.cgf.cx> Mail-Followup-To: gdb-patches@sourceware.org, Pierre Muller References: <000001c8d330$0c6b51f0$2541f5d0$@u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <000001c8d330$0c6b51f0$2541f5d0$@u-strasbg.fr> 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-06/txt/msg00366.txt.bz2 On Sat, Jun 21, 2008 at 01:47:48AM +0200, Pierre Muller wrote: >@@ -1076,7 +1079,13 @@ handle_exception (struct target_waitstat > break; > case EXCEPTION_BREAKPOINT: > DEBUG_EXCEPTION_SIMPLE ("EXCEPTION_BREAKPOINT"); >- ourstatus->value.sig = TARGET_SIGNAL_TRAP; >+ if (CtrlBreakSent) >+ { >+ CtrlBreakSent = 0; >+ ourstatus->value.sig = TARGET_SIGNAL_INT; >+ } >+ else >+ ourstatus->value.sig = TARGET_SIGNAL_TRAP; > break; > case DBG_CONTROL_C: > DEBUG_EXCEPTION_SIMPLE ("DBG_CONTROL_C"); This seems like a race condition to me. You can't be guaranteed that the breakpoint you're receiving is not a valid breakpoint. It would be better to check if it is a valid breakpoint and, if not, and iff CtrlBreakSent was true then do this. But two other observations: 1. I believe that MixedCase like this is against GNU coding standards but, even if it isn't, the convention in win32-nat.c is to use lowercase and underscores: ctrl_break_sent. 2. What is newconsole good for? I never use it and wonder if it shouldn't just be nuked. My usual refrain applies here: Is there anything similar in regular gdb? cgf