This is the mail archive of the gdb-patches@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]

Re: [RFA] findvar.c: support LOC_BASEREG[_ARG] on Harvard archs



Andrew Cagney <ac131313@cygnus.com> writes:

> 
> 
> >> -	char *buf = (char*) alloca (MAX_REGISTER_RAW_SIZE);
> >> +	value_ptr regval;
> 
> 
> value_ptr is really ``struct value *'' so ...
> 
> 
> >> +	regval = value_from_register (lookup_pointer_type (type),
> >> +				      SYMBOL_BASEREG (var), frame);
> >> +	if (regval == NULL)
> >> +	  error ("Value of base register not available.");
> >> +	addr = value_as_pointer (regval);
> 
> 
> I suspect you need xfree() or the like.

No --- all values get put in a global list, `all_values', which gets
freed automatically when the current expression evaluation is complete.
Grep for `all_values' and see how it gets used.


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