This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] MI: Free values when updating
On Wednesday 24 January 2007 12:14, Nick Roberts wrote:
> > > > @@ -1987,11 +1987,7 @@ c_value_of_root (struct varobj **var_han
> > > > /* We need to catch errors here, because if evaluate
> > > > expression fails we just want to make val->error = 1 and
> > > > go on */
> > >
> > > This comment is not applicable anymore.
> >
> > It actually is -- the comment says why we use gdb_evaluate_expression,
> > as opposed to evaluate_expression. Only the part about val->error is obsolete,
> > and I'll fix that.
>
> I'm not even sure that current use of gdb_evaluate_expression with variable
> objects is sensible. Currently GDB accepts:
>
> -var-create - * 1/0
>
> and if you do:
>
> -var-create - * n1/n2
>
> and n2 is set to 0, with "-var-update --all-values", GDB returns:
>
> ^done,changelist=[{name="var2",in_scope="false"}]
Yes. in_scope="false" actually means
"there's being some kind of error evaluating the expression". It's not very
clear but not a big problem either. It might be good to clean this up,
but I'm nore interested in fixing the (IMO) large scoping problems --
as I've suggested in -var-list --all-locals proposal.
- Volodya