Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Christopher Faylor <cgf-use-the-mailinglist-please@sourceware.org>
To: gdb-patches@sourceware.org, Yao Qi <yao@codesourcery.com>,
	Eli Zaretskii <eliz@gnu.org>
Subject: Re: [PATCH] Unbuffer stdout and stderr on windows
Date: Mon, 29 Jul 2013 19:26:00 -0000	[thread overview]
Message-ID: <20130729192559.GA5348@ednor.casa.cgf.cx> (raw)
In-Reply-To: <83wqohw4ee.fsf@gnu.org>

On Tue, Jul 23, 2013 at 08:51:53PM +0300, Eli Zaretskii wrote:
>> Date: Tue, 23 Jul 2013 14:34:32 +0800
>> From: Yao Qi <yao@codesourcery.com>
>> CC: <gdb-patches@sourceware.org>
>> 
>> On 07/22/2013 11:40 PM, Eli Zaretskii wrote:
>> > This is wrong, stdout should be line-buffered by default.
>> >
>> 
>> stdout is line-buffered if it can be detected to connect to an 
>> interactive device, otherwise it is fully buffered.  Cygwin emulates pty 
>> with pipes, and native win32 apps blindly assume all pipes are 
>> non-interactive.
>
>Sorry, I was unclear: I meant that stdout should be line-buffered, not
>unbuffered, when it is connected to a console (which is the default).
>I was under the impression that you were changing stdout to be
>unbuffered even in that default case, i.e. even when stdout is
>connected to a console.  If that's not so, i.e. if you were changing
>the buffering only when stdout is not connected to a console, I
>apologize for my misunderstanding.
>
>> > 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.
>> 
>> Yeah, this patch hurts the performance, but gets the outputs in the 
>> correct order, so that testsuite can be run to get a reasonable test result.
>
>I don't think it's right to penalize users for the benefit of the test
>suite.
>
>> > 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
>> 
>> Unfortunately, I am unable to find a heuristics to tell "GDB is in 
>> cygwin session".  There are some differences on env variables between 
>> cygwin and Windows cmd.exe console, but I am afraid that they are not 
>> reliable.
>
>Then how about introducing a special option which will cause the
>buffering to be what you want?  The test suite could use that option,
>and the other users will not suffer any penalty.
>
>> > behavior of a native w32 GDB just because it misbehaves when mixed
>> 
>> This patch is to change the buffered output to unbuffered, so the 
>> behaviour of GDB is not changed, IMO.
>
>Of course it's changed: buffering is user-visible behavior.
>
>> In the last resort, we may add an option "--cygwin-tty"
>
>I think this is the best alternative.
>
>> which I don't really like.
>
>Why not?

Note that this is only a problem for non-Cygwin versions of gdb.  It
sounds like someone is using mingw-built versions of gdb in a cygwin
pty session.  This obviously wouldn't be something that Cygwin itself
would need.

How about a "--buffer-output" option instead, which defaults to true?

cgf


  reply	other threads:[~2013-07-29 19:26 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-22  3:07 Yao Qi
2013-07-22 15:41 ` Eli Zaretskii
2013-07-23  6:35   ` Yao Qi
2013-07-23 17:52     ` Eli Zaretskii
2013-07-29 19:26       ` Christopher Faylor [this message]
2013-07-29 19:30         ` Eli Zaretskii
2013-07-29 19:51           ` Pedro Alves
2013-07-31  3:40             ` Christopher Faylor
2013-08-12 21:11               ` Joel Brobecker
2013-08-13 17:28                 ` Christopher Faylor
2013-08-13 18:08                 ` Eli Zaretskii
2013-08-14  0:05                   ` Joel Brobecker
2013-08-15 17:36                   ` Christopher Faylor
2013-08-15 17:44                     ` Eli Zaretskii
2013-08-15 17:59                       ` Christopher Faylor
2013-08-15 18:44                         ` Eli Zaretskii
2013-08-16 11:46                         ` Pedro Alves
2013-08-16 12:34                           ` Yao Qi
2013-08-16 13:20                             ` Eli Zaretskii
2013-08-16 13:37                             ` Pedro Alves
2013-08-16 14:03                               ` Eli Zaretskii
2013-08-16 14:21                                 ` Pedro Alves
2013-08-16 14:57                                   ` Eli Zaretskii
2013-08-16 15:10                                     ` Pedro Alves
2013-08-16 15:24                                       ` Pedro Alves
2013-08-16 15:43                                         ` Eli Zaretskii
2013-08-16 16:41                                           ` Christopher Faylor
2013-08-16 15:41                                       ` Eli Zaretskii
2013-08-22  6:14                                       ` Yao Qi
2013-08-22 14:18                                         ` Joel Brobecker
2013-08-23  2:20                                           ` Yao Qi
2013-08-23 13:38                                             ` Joel Brobecker
2013-08-27 20:39                                             ` Pedro Alves
2013-08-28  7:23                                               ` Yao Qi
2013-08-28  9:39                                                 ` Pedro Alves
2013-08-28 12:25                                                   ` Yao Qi
2013-08-16 13:17                           ` Eli Zaretskii
2013-08-16 13:30                             ` Pedro Alves
2013-08-16 13:42                               ` Eli Zaretskii
2013-08-16 14:13                                 ` Pedro Alves
2013-08-16 14:44                                   ` Eli Zaretskii
2013-08-16 15:05                                     ` Pedro Alves
2013-08-16 15:13                                       ` Eli Zaretskii
2013-07-29 19:30         ` Christopher Faylor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130729192559.GA5348@ednor.casa.cgf.cx \
    --to=cgf-use-the-mailinglist-please@sourceware.org \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=yao@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox