This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Processing of convenience variables for scripts ...


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]