This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/3] Detect GDB is in cygwin
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Cc: Yao Qi <yao at codesourcery dot com>
- Date: Thu, 15 Aug 2013 12:58:05 -0600
- Subject: Re: [PATCH 1/3] Detect GDB is in cygwin
- References: <83a9l4xdst dot fsf at gnu dot org> <51FA137B dot 6070207 at codesourcery dot com> <20130803045452 dot GA997 at ednor dot casa dot cgf dot cx> <51FE1493 dot 9070707 at codesourcery dot com> <20130805044122 dot GA1825 at ednor dot casa dot cgf dot cx> <51FF4483 dot 5000102 at codesourcery dot com> <20130806020839 dot GA3362 at ednor dot casa dot cgf dot cx> <520067CB dot 4000300 at codesourcery dot com> <20130808051114 dot GA1553 at ednor dot casa dot cgf dot cx> <5203477B dot 8090203 at codesourcery dot com> <20130815174010 dot GB6955 at ednor dot casa dot cgf dot cx>
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