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: Christopher Faylor <cgf-use-the-mailinglist-please at sourceware dot org>
- To: gdb-patches at sourceware dot org, Yao Qi <yao at codesourcery dot com>
- Date: Thu, 8 Aug 2013 01:11:14 -0400
- Subject: Re: [PATCH 1/3] Detect GDB is in cygwin
- References: <83txjdxtpd dot fsf at gnu dot org> <51F786CB dot 3020700 at codesourcery dot com> <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>
On Tue, Aug 06, 2013 at 11:04:43AM +0800, Yao Qi wrote:
>On 08/06/2013 10:08 AM, Christopher Faylor wrote:
>> I'm saying that it looks like your code will detect "echo yes | gdb"
>> as running on a cygwin pty.
>
>In this case, the file name of handle looks like
>"\cygwin-c5e39b7a9d22bafb-pipe-0xBC0-0x1". It is expected to return
>true in this case too, that is to say, we need to set stdout/stderr
>unbuffered in this case too.
If you're just going to always set to unbuffered when something
is a pipe, why not just check for a pipe using GetFileType? Then
you don't have to try to use an undocumented Cygwin behaviour.
cgf