Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Vladimir Prus <ghost@cs.msu.su>
Cc: gdb@sources.redhat.com
Subject: Re: printfs output in wrong order in MI
Date: Thu, 13 Apr 2006 16:04:00 -0000	[thread overview]
Message-ID: <upsjl3jza.fsf@gnu.org> (raw)
In-Reply-To: <200604131201.58613.ghost@cs.msu.su> (message from Vladimir Prus 	on Thu, 13 Apr 2006 12:01:57 +0400)

> From: Vladimir Prus <ghost@cs.msu.su>
> Date: Thu, 13 Apr 2006 12:01:57 +0400
> Cc: gdb@sources.redhat.com
> 
> > > (that is, adding "\n"), fixes the problem. Still looks like a bug to me,
> > > though.
> >
> > I think it's expected behavior: printf uses buffered output, 
> 
> Where in documentation is it stated that 'printf' uses buffered output?

I'll welcome patches to document that, TIA.

> Isn't it possible to auto-flush the buffer at the end of "-interpreter-exec 
> console" execution it's possible to flush the buffers?

It is usually a performance tradeoff: GDB has no idea whether a single
printf command is all you will want to print, or a part of a block of
commands that your front end feeds one after the other.  In the latter
case, flushing the buffers will be a performance hit.

The current code assumes that \n marks the end of the values you want
to see output, so line buffering generally does The Right Thing
(because, at least in interactive CLI usage, no one in their right
mind will want to print strings unterminated by a newline: it would
cause the next GDB prompt to not be the first thing on the line).

> I think it's reasonable to expect that *all* output of command
> wrapped in "-interpreter-exec console" would appears before the
> "^done" marker.

Is it?  I wouldn't know; I'll let other front-end gurus to comment on
that.


  reply	other threads:[~2006-04-13  9:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-12 16:54 Vladimir Prus
2006-04-13  8:02 ` Vladimir Prus
2006-04-13  8:10   ` Eli Zaretskii
2006-04-13  8:20     ` Vladimir Prus
2006-04-13 16:04       ` Eli Zaretskii [this message]
2006-04-14 13:38         ` Daniel Jacobowitz

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=upsjl3jza.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=gdb@sources.redhat.com \
    --cc=ghost@cs.msu.su \
    /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