From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24233 invoked by alias); 26 Apr 2010 18:24:12 -0000 Received: (qmail 24217 invoked by uid 22791); 26 Apr 2010 18:24:09 -0000 X-Spam-Check-By: sourceware.org Received: from pool-173-76-55-5.bstnma.fios.verizon.net (HELO cgf.cx) (173.76.55.5) by sourceware.org (qpsmtpd/0.83/v0.83-20-g38e4449) with ESMTP; Mon, 26 Apr 2010 18:24:03 +0000 Received: from ednor.cgf.cx (ednor.casa.cgf.cx [192.168.187.5]) by cgf.cx (Postfix) with ESMTP id 9E31513C061; Mon, 26 Apr 2010 14:24:01 -0400 (EDT) Received: by ednor.cgf.cx (Postfix, from userid 201) id 9772C2B352; Mon, 26 Apr 2010 14:24:01 -0400 (EDT) Date: Mon, 26 Apr 2010 18:24:00 -0000 From: Christopher Faylor To: gdb-patches@sourceware.org, Pierre Muller Subject: Re: [RFA] windows-nat.c: Enable processed input at startup Message-ID: <20100426182401.GB4552@ednor.casa.cgf.cx> Mail-Followup-To: gdb-patches@sourceware.org, Pierre Muller 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> <006f01cae557$d081bf80$71853e80$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <006f01cae557$d081bf80$71853e80$@muller@ics-cnrs.unistra.fr> User-Agent: Mutt/1.5.20 (2009-06-14) 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/msg00885.txt.bz2 On Mon, Apr 26, 2010 at 05:47:45PM +0200, Pierre Muller wrote: >> >> 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. How is this a cygwin-specific problem? You can do the similar things on linux by resetting CTRL-C handling. Does gdb accommodate that? If so, then whatever works for linux should work for Cygwin. >>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? Uh, what? You can't call a lowlevel Cygwin function from outside of the DLL. You'd need to use the tcsetattr API. Again, this would be similar to the way UNIX/Linux handle it and I would think that Cygwin would be able to use whatever code they use. cgf