This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: Processing of convenience variables for scripts ...
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: Richard Sharpe <rsharpe at richardsharpe dot com>
- Cc: gdb at sources dot redhat dot com
- Date: Fri, 6 Dec 2002 11:42:14 -0500
- Subject: Re: Processing of convenience variables for scripts ...
- References: <Pine.LNX.4.33.0212060853160.30583-100000@ns.aus.com>
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)
That said, I'm not worried about implementing this as much as I am
designing what it "ought" to look like.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer