From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30868 invoked by alias); 7 Dec 2002 16:50:24 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 30861 invoked from network); 7 Dec 2002 16:50:23 -0000 Received: from unknown (HELO ns.aus.com) (66.127.241.71) by sources.redhat.com with SMTP; 7 Dec 2002 16:50:23 -0000 Received: from localhost (rsharpe@localhost) by ns.aus.com (8.11.6/8.11.6) with ESMTP id gB7HGe904376; Sat, 7 Dec 2002 09:16:40 -0800 X-Authentication-Warning: ns.aus.com: rsharpe owned process doing -bs Date: Sat, 07 Dec 2002 08:50:00 -0000 From: Richard Sharpe X-X-Sender: To: Daniel Jacobowitz cc: Subject: Re: Processing of convenience variables for scripts ... In-Reply-To: <20021206164214.GA27660@nevyn.them.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2002-12/txt/msg00155.txt.bz2 On Fri, 6 Dec 2002, Daniel Jacobowitz wrote: > On Fri, Dec 06, 2002 at 08:57:07AM -0800, Richard Sharpe wrote: > > Hi, > > > > In looking at this issue, it seems that much of the existing code that > > deals with variables is centered around printing: > > > > value_print (var->value, gdb_stdout, 0, Val_pretty_default); > > > > While it seems that I could mess with providing new functions for a stream > > structure that I could retrieve strings from, is there a simpler way. > > > > I envision something like > > > > var1 = value_to_string (var->value); > > > > And then construct a new command, and pass it through the standard routine > > that processes commands. > > > > However, it seems that things are not that simple :-) > > You're looking in the wrong place, I'd say. Look in parse.c for the > call to: > lookup_internalvar (copy_name (str) + 1) OK, but the problem there is that lookup_internalvar returns a struct internalvar *. While there is a function value_of_internal var (also in values.c), it returns a struct value *. I need the value of an internal var as something approximating a C string, and the only functions that deal with displaying the value of an internal variable (or any variable, it seems) is value_print, which wants a struct ui_file *. Or so it seems? Have the recreational drugs finally proven too much, or have I got it right here? Regards ----- Richard Sharpe, rsharpe[at]ns.aus.com, rsharpe[at]samba.org, sharpe[at]ethereal.com, http://www.richardsharpe.com