This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/3] Unbuffer stdout and stderr in cygwin
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Yao Qi <yao at codesourcery dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 29 Jul 2013 18:42:16 +0300
- Subject: Re: [PATCH 2/3] Unbuffer stdout and stderr in cygwin
- References: <1375087546-22591-1-git-send-email-yao at codesourcery dot com> <1375087546-22591-3-git-send-email-yao at codesourcery dot com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> From: Yao Qi <yao@codesourcery.com>
> Date: Mon, 29 Jul 2013 16:45:45 +0800
>
> +#ifdef __MINGW32__
> + if (is_in_cygwin_p ())
I would suggest to call the function using_cygwin_pty or some such.
"is_in_cygwin" is IMO too ambiguous.
> + setvbuf (stdout, NULL, _IONBF, BUFSIZ);
> + setvbuf (stderr, NULL, _IONBF, BUFSIZ);
How about using line buffering instead on both streams? Or at least
leave stdout line-buffered? Did you try that, and if so, did that
have the same problems that triggered these patches?
You see, the way your patch works, using GDB from a Cygwin shell
window will always do the above, even when not running the test
suite. Users might be unhappy that their standard output suddenly
becomes much less efficient.