Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Christopher Faylor <cgf-use-the-mailinglist-please@sourceware.org>
To: palves@redhat.com, gdb-patches@sourceware.org,
	yao@codesourcery.com,	Joel Brobecker <brobecker@adacore.com>,
	Eli Zaretskii <eliz@gnu.org>
Subject: Re: [PATCH] Unbuffer stdout and stderr on windows
Date: Thu, 15 Aug 2013 17:36:00 -0000	[thread overview]
Message-ID: <20130815173618.GA6955@ednor.casa.cgf.cx> (raw)
In-Reply-To: <8361v9piop.fsf@gnu.org>

On Tue, Aug 13, 2013 at 09:08:38PM +0300, Eli Zaretskii wrote:
>> Date: Mon, 12 Aug 2013 14:11:05 -0700
>> From: Joel Brobecker <brobecker@adacore.com>
>> 
>> > We had a somewhat heated debate in the cygwin list about using the
>> > techniques in winpty and eventually abandoned the idea because the way
>> > things like winpty create consoles is not foolproof.  Since it relies on
>> > polling, it is theoretically possible to lose data.
>> > 
>> > I'll bet that, in practice you'd never see any data loss, though.
>> > And, from that observation, you can see which side of the argument
>> > I was on.  :-)
>> 
>> FWIW, many frontends also implements communication with GDB using
>> pipes on Windows, and running MinGW-gdb inside cygwin window/shell
>> is just a very very common practice, regardless of whether officially
>> supported or not. How does Emacs do, for instance? IIRC when I looked
>> at the code, that's what it did.
>
>Yes, Emacs does that.  But it is never a problem in that case, because
>it's the user who looks at the results, not a program that wants to
>interpret them.
>
>> Having the stdout/stderr output mixed up is very confusing and breaks
>> testing as well, so we applied the same approach as Yao's at AdaCore.
>
>Making GDB output unbuffered is not a good idea for Emacs, because it
>will cause it read single characters, which is (a) inefficient, and
>(b) error-prone, because a single CR character could dupe the text
>decoding routines into thinking the EOL format is from Mac.

I thought that "unbuffered" normally means something like "every output
operation gets immediately sent as a block" rather than "flush
after every character".  If the mingw "unbuffered" mode means that
everything is o n e  c h a r a c t e r  a t  a  t i m e, then that
would obviously not be an acceptable solution.  Or, maybe this is just
the way emacs itself works.

The other alternative would be to use line buffering for gdb.  I don't
see why cygwin pipes (whether they are "ptys" or actual pipes) are a
special case here.  stdout is usually line buffered isn't it?  Why not
just force that behavior for gdb?

cgf


  parent reply	other threads:[~2013-08-15 17:36 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
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 [this message]
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=20130815173618.GA6955@ednor.casa.cgf.cx \
    --to=cgf-use-the-mailinglist-please@sourceware.org \
    --cc=brobecker@adacore.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    --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