Re: [PATCH 1/3] Detect GDB is in cygwin

Tom Tromey
2013-08-15T18:58:10Z

cgf> I really don't like having gdb rely on undocumented Cygwin behavior.
cgf> You're introducing a tenuous dependency between the way Cygwin creates
cgf> ptys and pipes which could easily break if we decide to change something
cgf> in Cygwin.

One other idea that comes to mind is implementing the buffering and even
line-ending transformations in gdb. I think most output like this in
gdb winds up in stdio_file_write and stdio_file_fputs.

The idea is something like, for Windows hosts, put stdout and stderr
into "binary" mode. Then, have those two functions implement line
buffering internally (again just for Windows hosts). Finally, have them
also transform \n -> \r\n on output.

Would this work?

Tom