This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [RFA] windows-nat.c: Enable processed input at startup
- From: "Pierre Muller" <pierre dot muller at ics-cnrs dot unistra dot fr>
- To: <gdb-patches at sourceware dot org>
- Date: Mon, 26 Apr 2010 17:47:45 +0200
- Subject: RE: [RFA] windows-nat.c: Enable processed input at startup
- 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>
> >> 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 <muller@ics.u-strasbg.fr>
> >
> > * 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