This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] -var-update
> > > BTW, why coerce_ref is not
> > > suitable here?
> >
> > coerce_ref ensures that the address is placed in the value's contents, not
> > the actual value which is being referred to.
>
> Did you try that? That certainly shouldn't be true!
Yes. Perhaps my summary isn't precise, but it didn't work. My patch uses
value_at while coerce_ref uses value_at_lazy. The comment says:
Call value_at only if the data needs to be fetched immediately;
if we can be 'lazy' and defer the fetch, perhaps indefinately, call
^^^^^^^^^^^^
value_at_lazy instead. value_at_lazy simply records the address of
the data and sets the lazy-evaluation-required flag. The lazy flag
is tested in the value_contents macro, which is used if and when
the contents are actually required.
value_contents is not a macro (VALUE_CONTENTS used to be one) but a function,
and doesn't test the lazy flag. So the comment is out of date, but perhaps
the `data' (I don't know what that means exactly) is never fetched when
-var-update is issued.
--
Nick http://www.inet.net.nz/~nickrob