This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Unbuffer stdout and stderr on windows
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Pedro Alves <palves at redhat dot com>
- Cc: gdb-patches at sourceware dot org, brobecker at adacore dot com, yao at codesourcery dot com
- Date: Fri, 16 Aug 2013 16:17:43 +0300
- Subject: Re: [PATCH] Unbuffer stdout and stderr on windows
- References: <51EE23F8 dot 1070905 at codesourcery dot com> <83wqohw4ee dot fsf at gnu dot org> <20130729192559 dot GA5348 at ednor dot casa dot cgf dot cx> <83d2q1xiyv dot fsf at gnu dot org> <51F6C7B2 dot 3020400 at redhat dot com> <20130731034045 dot GA5565 at ednor dot casa dot cgf dot cx> <20130812211105 dot GA11128 at adacore dot com> <8361v9piop dot fsf at gnu dot org> <20130815173618 dot GA6955 at ednor dot casa dot cgf dot cx> <83eh9uonlg dot fsf at gnu dot org> <20130815175940 dot GD6955 at ednor dot casa dot cgf dot cx> <520E1109 dot 7000304 at redhat dot com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Fri, 16 Aug 2013 12:46:17 +0100
> From: Pedro Alves <palves@redhat.com>
>
> IMO, stderr should _always_ be forced to unbuffered.
We are in agreement about stderr. The issue is with stdout.
> I can't really imagine that leaving stdout fully buffered to
> ever be good (which the cygwin detection seems to want to preserve),
> even for frontends, given GDB is an interactive program, and even
> MI is text/line based.
If the choice is between fully buffered stdout and unbuffered stdout,
I prefer the former for performance reasons.
> So I think the "in cygwin" detection is really not necessary
> or desirable, and this patch should go back to its original form:
>
> +#ifdef _WIN32
> + /* A Cygwin ssh session may not look like a terminal to the Windows
> + runtime; ensure unbuffered output. */
> + setvbuf (stdout, NULL, _IONBF, BUFSIZ);
> + setvbuf (stderr, NULL, _IONBF, BUFSIZ);
> +#endif
Sorry, I disagree. No one has ever complained about the current
buffering of stdout on Windows. The issue that is the subject of this
thread is a problem that happens in running the test suite. I firmly
believe in the principle of not fixing that which isn't broken.