Re: [PATCH] -var-update [was Re: Variable objects: references formatting]

Daniel Jacobowitz
2006-05-17T00:45:32Z

On Wed, May 17, 2006 at 11:52:31AM +1200, Nick Roberts wrote:
> > For instance:
> >
> > /* The contents of VAL1 are supposed to be known. */
> > gdb_assert (!value_lazy (val1));
> >
> > If val1 is the reference at this point, then we haven't checked what we
> > think we have.
>
> Trying to interpret the code, given that val1 doesn't hold the value I
> wonder why this assertion is true i.e why is value->lazy=0 even though
> the value isn't in the contents field.

I am not sure what you mean.

!value_lazy (val1) means the contents of val1 have already been read
from the target. At this point, val1 is the _reference_. Nothing is
arranging to cache the value pointed to; that's what needs to happen.

> > Every time my_value_equal is called its first argument comes from a
> > varobj's ->value. It seems to me that if we want to properly know
> > whether the varobj has changed, we'd better have read its value into
> > GDB.
>
> Could it not doing that because GDB's value mechanism isn't working properly
> for references?

The value mechanism is working fine; it's varobj that does not support
references.

--
Daniel Jacobowitz
CodeSourcery