public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@redhat.com>
To: Kris Warkentin <kewarken@qnx.com>
Cc: "Gdb@Sources.Redhat.Com" <gdb@sources.redhat.com>
Subject: Re: ui-out question
Date: Sun, 01 Jun 2003 17:42:00 -0000	[thread overview]
Message-ID: <3EDA3B0A.10603@redhat.com> (raw)
In-Reply-To: <027201c326d3$b480a2f0$0202040a@catdog>

> I'm seeing that much of the generated text in gdb is using ui-out routines
> rather that printf_unfiltered, etc.  Is this the 'state of the art' that
> should be used at all times?  That is, should I be converting my output
> routines to use that?

Code should use fprintf_*, or ui_out*.  Which is used is a judgment 
call.  If a routine is just pumping info out to the console than 
fprintf_* are fine.  If the intent is to build up something for an mi 
operation then the ui_out* is best.

> The question that arises from that is the whole 'from_tty' argument that
> gets passed around everywhere.  Would it make more sense, if we're using the
> ui-out routines anyway, to just let them make the decision about whether or
> not to display stuff?  Or am I misreading the purpose of from_tty.  If
> false, does it mean, "Do NO output", or does it mean, "Be less verbose."?

I _think_ from_tty is disabled when --batch (look for "batch" in 
main.c).  It's effect is to modify (supress) the CLI output when in 
batch mode.

> I'm thinking that the from_tty might be useful for functions that want to
> silently call other functions regardless of the overall setting.  Something
> like ui_out_push_output_state(0), ui_out_pop_output_state() would work for
> temporarily shutting down output in this case which I believe is somewhat
> rare.

It could.  Do you have more details of the problem at hand.

Andrew


  parent reply	other threads:[~2003-06-01 17:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-30 17:48 Kris Warkentin
2003-05-31 11:31 ` Kris Warkentin
2003-06-01 17:42 ` Andrew Cagney [this message]
2003-06-03 11:35   ` Kris Warkentin
2003-06-22 15:13     ` Andrew Cagney

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=3EDA3B0A.10603@redhat.com \
    --to=ac131313@redhat.com \
    --cc=gdb@sources.redhat.com \
    --cc=kewarken@qnx.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).