This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Unbuffer stdout and stderr on windows


> From: Yao Qi <yao@codesourcery.com>
> Date: Mon, 22 Jul 2013 11:06:57 +0800
> 
> +#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

This is wrong, stdout should be line-buffered by default.

Also, this punishes batch mode with stdout redirected to a file: its
stdout buffering (and perhaps also that of stderr, although that's
less important) will now always be line-buffered, i.e. less efficient.

Is it possible to detect the "Cygwin ssh session", whatever that
means, and only do this then?  I don't think it's right to change
behavior of a native w32 GDB just because it misbehaves when mixed
with Cygwin.  Mixing native and Cygwin programs is asking for trouble
to begin with, so punishing good citizens on behalf of that corner
case is not TRT, IMO.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]