From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10592 invoked by alias); 22 Jul 2002 19:18:55 -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 10576 invoked from network); 22 Jul 2002 19:18:53 -0000 Received: from unknown (HELO localhost.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 22 Jul 2002 19:18:53 -0000 Received: from ges.redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id B50E03CEB; Mon, 22 Jul 2002 15:18:53 -0400 (EDT) Message-ID: <3D3C5A9D.2010409@ges.redhat.com> Date: Mon, 22 Jul 2002 12:18:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.0) Gecko/20020708 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Daniel Jacobowitz Cc: gdb-patches@sources.redhat.com, insight@sources.redhat.com Subject: Re: RFA: Make cli-out follow gdb_stdout References: <20020717183012.GA9788@nevyn.them.org> <3D3C4AFF.2090003@ges.redhat.com> <20020722182149.GA5211@nevyn.them.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-q3/txt/msg00029.txt.bz2 > 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. So the assertion: global uiout->stream->ui_file == global gdb_stdout doesn't hold :-( > 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? Both of those are still wrong. The global gdb_stdout should be going away replaced with some sort of explicitly parameterized i/o object. That is why catch_exceptions() takes a ui_out. enjoy, Andrew