From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19302 invoked by alias); 21 Sep 2009 15:24:36 -0000 Received: (qmail 19290 invoked by uid 22791); 21 Sep 2009 15:24:35 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.157) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 21 Sep 2009 15:24:30 +0000 Received: from baal.u-strasbg.fr (baal.u-strasbg.fr [IPv6:2001:660:2402::41]) by mailhost.u-strasbg.fr (8.14.2/jtpda-5.5pre1) with ESMTP id n8LFOR6S003654 for ; Mon, 21 Sep 2009 17:24:27 +0200 (CEST) (envelope-from muller@ics.u-strasbg.fr) Received: from mailserver.u-strasbg.fr (ms1.u-strasbg.fr [IPv6:2001:660:2402:d::10]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id n8LFORK8084522 for ; Mon, 21 Sep 2009 17:24:27 +0200 (CEST) (envelope-from muller@ics.u-strasbg.fr) Received: from d620muller (www-ics.u-strasbg.fr [130.79.210.225]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id n8LFOQAE073109 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Mon, 21 Sep 2009 17:24:26 +0200 (CEST) (envelope-from muller@ics.u-strasbg.fr) From: "Pierre Muller" To: Subject: [RFA] windows-nat.c: Handle CTRL_BREAK_EVENT in ctrl_c_handler Date: Mon, 21 Sep 2009 15:24:00 -0000 Message-ID: <002001ca3acf$a0d8bb40$e28a31c0$@u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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: 2009-09/txt/msg00665.txt.bz2 Using Ctrl-C to interrupt a running application does not always work nicely because the application can decide to handle Ctrl-C as a normal character. On the contrary, Ctrl-Break always generates a call to the installed SetConsoleCtrlHandler. This patch allows me to interrupt a debuggee running in another console (with 'set new-console on') by pressing Ctrl-Break, even, if Ctrl-C has been transformed by the debuggee as a normal char using SetConsoleMode API function. Pierre Muller Pascal language support maintainer for GDB 2009-09-21 Pierre Muller * src/gdb/windows-nat.c (ctrl_c_handler): Also handle CTRL_BREAK_EVENT. Index: src/gdb/windows-nat.c =================================================================== RCS file: /cvs/src/src/gdb/windows-nat.c,v retrieving revision 1.196 diff -u -p -r1.196 windows-nat.c --- src/gdb/windows-nat.c 2 Jul 2009 17:21:07 -0000 1.196 +++ src/gdb/windows-nat.c 21 Sep 2009 14:53:38 -0000 @@ -1289,8 +1304,8 @@ ctrl_c_handler (DWORD event_type) { const int attach_flag = current_inferior ()->attach_flag; - /* Only handle Ctrl-C event. Ignore others. */ - if (event_type != CTRL_C_EVENT) + /* Only handle Ctrl-C and Ctrl-Break events. Ignore others. */ + if (event_type != CTRL_C_EVENT && event_type != CTRL_BREAK_EVENT) return FALSE; /* If the inferior and the debugger share the same console, do nothing as