From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32397 invoked by alias); 22 Jul 2002 18:21:49 -0000 Mailing-List: contact insight-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: insight-owner@sources.redhat.com Received: (qmail 32296 invoked from network); 22 Jul 2002 18:21:48 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by sources.redhat.com with SMTP; 22 Jul 2002 18:21:48 -0000 Received: from dsl254-114-118.nyc1.dsl.speakeasy.net ([216.254.114.118] helo=nevyn.them.org ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 17Whoa-0001Fn-00; Mon, 22 Jul 2002 13:21:48 -0500 Received: from drow by nevyn.them.org with local (Exim 3.35 #1 (Debian)) id 17Whob-0001PZ-00; Mon, 22 Jul 2002 14:21:49 -0400 Date: Mon, 22 Jul 2002 11:21:00 -0000 From: Daniel Jacobowitz To: Andrew Cagney Cc: gdb-patches@sources.redhat.com, insight@sources.redhat.com Subject: Re: RFA: Make cli-out follow gdb_stdout Message-ID: <20020722182149.GA5211@nevyn.them.org> Mail-Followup-To: Andrew Cagney , gdb-patches@sources.redhat.com, insight@sources.redhat.com References: <20020717183012.GA9788@nevyn.them.org> <3D3C4AFF.2090003@ges.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3D3C4AFF.2090003@ges.redhat.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2002-q3/txt/msg00028.txt.bz2 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