From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28296 invoked by alias); 26 Apr 2010 15:47:42 -0000 Received: (qmail 28285 invoked by uid 22791); 26 Apr 2010 15:47:42 -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.151) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 26 Apr 2010 15:47:38 +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 o3QFlYJs002452 for ; Mon, 26 Apr 2010 17:47:34 +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 o3QFlYav035950 for ; Mon, 26 Apr 2010 17:47:34 +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 o3QFlYbC054800 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Mon, 26 Apr 2010 17:47:34 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: References: <005401cae535$61adadc0$25090940$@muller@ics-cnrs.unistra.fr> <20100426143241.GB1534@ednor.casa.cgf.cx> <006901cae552$36e27450$a4a75cf0$@muller@ics-cnrs.unistra.fr> <20100426152011.GA1856@ednor.casa.cgf.cx> In-Reply-To: <20100426152011.GA1856@ednor.casa.cgf.cx> Subject: RE: [RFA] windows-nat.c: Enable processed input at startup Date: Mon, 26 Apr 2010 15:47:00 -0000 Message-ID: <006f01cae557$d081bf80$71853e80$@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/msg00877.txt.bz2 > >> setting was global. > > Of course I should close the handle as soon as I changed the > >console mode. > > What about this version? > > > >Pierre > > > >2010-04-26 Pierre Muller > > > > * windows-nat.c (_initialize_windows_nat): Try to set > > ENABLE_PROCESSED_INPUT for console mode if accessible. > > Ok with the minor comment changes below. Did you mean something to change to the comments inside the patch? > I don't understand why this would be necessary for Cygwin but, Did you try the example code I sent to gdb mailing list? This executable does change the Console Mode of a Cygwin tty and that change is kept after the program exits. This is not the case for a usual Windows command prompt. If you compile my program and run it. ./test New console mode is 0x18 (interrupting this works for both Ctrl-C and Ctrl-Break) but if you now run gdb gdb .... (gdb) set prompt top> top> run ... Try to hit Ctrl-C now, nothing happens (exit using q) Run again my test program with an argument: ./test 1 New console mode is 0x19 Do the same... This time Ctrl-C works. > if it is, > then tcsetattr should be used. From winsup/cygwin/fhanlde_console.cc I suppose that I should use tcsetattr (tcgetattr (h) | ISIG, h); But what should the variable 'h' be be initialized? Pierre