From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14386 invoked by alias); 26 Apr 2010 11:41:21 -0000 Received: (qmail 14373 invoked by uid 22791); 26 Apr 2010 11:41:20 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00,MSGID_MULTIPLE_AT 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, 26 Apr 2010 11:41:12 +0000 Received: from baal.u-strasbg.fr (baal.u-strasbg.fr [IPv6:2001:660:2402::41]) by mailhost.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id o3QBf9kQ013837 for ; Mon, 26 Apr 2010 13:41:09 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from mailserver.u-strasbg.fr (ms2.u-strasbg.fr [IPv6:2001:660:2402:d::11]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id o3QBf9kh053330 for ; Mon, 26 Apr 2010 13:41:09 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from d620muller (gw-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 o3QBf8Us023201 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Mon, 26 Apr 2010 13:41:09 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: Subject: [RFA] windows-nat.c: Enable processed input at startup Date: Mon, 26 Apr 2010 11:41:00 -0000 Message-ID: <005401cae535$61adadc0$25090940$@muller@ics-cnrs.unistra.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: 2010-04/txt/msg00861.txt.bz2 This is the patch I was talking about in a reply to this thread: http://sourceware.org/ml/gdb/2010-04/msg00113.html It ensures that at startup, if GDB can connect to the console the console mode is modified to enable processed input. This make '^C' (ascii #3) to be interpreted as a control event. Pierre Muller Pascal language support maintainer for GDB 2010-04-26 Pierre Muller * windows-nat.c (_initialize_windows_nat): Try to set ENABLE_PROCESSED_INPUT for console mode if accessible. Index: windows-nat.c =================================================================== RCS file: /cvs/src/src/gdb/windows-nat.c,v retrieving revision 1.208 diff -u -p -r1.208 windows-nat.c --- windows-nat.c 16 Apr 2010 07:49:35 -0000 1.208 +++ windows-nat.c 26 Apr 2010 11:33:08 -0000 @@ -2356,6 +2356,22 @@ void _initialize_windows_nat (void) { struct cmd_list_element *c; + HANDLE std_in_handle; + + /* Try to enable processed input for the console. + This should allow to use '^C' to interrupt the debuggee + at least as log as the debugge does not modify the + console mode settings. */ + std_in_handle = CreateFile ("CONIN$", GENERIC_READ | GENERIC_WRITE, + FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0); + + if (std_in_handle != INVALID_HANDLE_VALUE) + { + DWORD console_mode; + CHECK (GetConsoleMode (std_in_handle, &console_mode)); + console_mode = console_mode | ENABLE_PROCESSED_INPUT; + CHECK (SetConsoleMode (std_in_handle, console_mode)); + } init_windows_ops ();