public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@mvista.com>
To: Andrew Cagney <ac131313@ges.redhat.com>
Cc: gdb-patches@sources.redhat.com, insight@sources.redhat.com
Subject: Re: RFA: Make cli-out follow gdb_stdout
Date: Mon, 22 Jul 2002 11:21:00 -0000	[thread overview]
Message-ID: <20020722182149.GA5211@nevyn.them.org> (raw)
In-Reply-To: <3D3C4AFF.2090003@ges.redhat.com>

On Mon, Jul 22, 2002 at 02:12:15PM -0400, Andrew Cagney wrote:
> FYI,
> 
> This:
> 
> > struct ui_out_data
> >   {
> >-    struct ui_file *stream;
> >+    struct ui_file **stream;
> >     int suppress_output;
> >   };
> 
> and this:
> 
> >-      uiout = cli_out_new (gdb_stdout);
> >+      uiout = cli_out_new (&gdb_stdout);
> 
> worry me.
> 
> The intent is to eventually have everything using a parameterized output 
> object - if you want to change where output goes, change the parameter. 
>  Given that, having stuff depend on an indirect global pointer looks to 
> be going in the wrong direction.
> 
> I'll need to look over the problems that Pierre was trying to solve.

I'm not thrilled with it myself.  Let me explain what I'm trying to do,
and let's see if we can come up with a better model.

I have a function which temporarily redirects GDB's output.  How does
it do this?  Well, the best way seems to be to modify
gdb_std{out,err,log}.  But the old value of gdb_stdout is cached in the
cli_out object.

The two minimal solutions were the one above (using a ui_file**) or
hardcoding gdb_stdout (since that's the only thing it's ever used for
at present).  They're both a bit of a step backwards.  I could provide
methods to query and set the underlying stream of a ui_out object, but
the differences between the different ui_out objects make that a little
awkward.  Would that be better?

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer

  reply	other threads:[~2002-07-22 18:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-17 11:30 Daniel Jacobowitz
2002-07-22 11:12 ` Andrew Cagney
2002-07-22 11:21   ` Daniel Jacobowitz [this message]
2002-07-22 12:18     ` Andrew Cagney
2002-07-22 12:41       ` Daniel Jacobowitz
2002-07-22 13:11         ` Andrew Cagney
2002-07-22 13:18           ` 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=20020722182149.GA5211@nevyn.them.org \
    --to=drow@mvista.com \
    --cc=ac131313@ges.redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=insight@sources.redhat.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).