From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4321 invoked by alias); 26 Apr 2010 15:20:18 -0000 Received: (qmail 4266 invoked by uid 22791); 26 Apr 2010 15:20:17 -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 15:20:13 +0000 Received: from ednor.cgf.cx (ednor.casa.cgf.cx [192.168.187.5]) by cgf.cx (Postfix) with ESMTP id 8ADCD13C061; Mon, 26 Apr 2010 11:20:11 -0400 (EDT) Received: by ednor.cgf.cx (Postfix, from userid 201) id 842372B352; Mon, 26 Apr 2010 11:20:11 -0400 (EDT) Date: Mon, 26 Apr 2010 15:20: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: <20100426152011.GA1856@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <006901cae552$36e27450$a4a75cf0$@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/msg00875.txt.bz2 On Mon, Apr 26, 2010 at 05:07:40PM +0200, Pierre Muller wrote: > >> >+ 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 (); >> >> That has to be conditional on __CYGWIN__ since you'll be screwing up >> Cygwin's >> notion of the console state. > > Is there a Cygwin way to do the same? > >> And, the name std_in_handle is a misnomer. It should be console_handle >> or something like that. > Renamed to conin_handle. >> Can't you just set what you need and close the handle? I thought this >> 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. I don't understand why this would be necessary for Cygwin but, if it is, then tcsetattr should be used. cgf