Re: [RFA] Document fixed/floating variable objects and thread-id.

Eli Zaretskii
2008-04-23T17:48:15Z

> From: Vladimir Prus <vladimir@codesourcery.com>
> Date: Wed, 23 Apr 2008 14:26:14 +0400
>
> > void foo (int i)
> > {
> > ...
> > }
> >
> > void bar (int i)
> > {
> > ...
> > }
> >
> >
> > If you create a fixed varobj in 'bar', then each time you updating, new value of
> > bar's i will be read. If you create a floating varobj in 'bar', then if you update
> > it while still in bar, new value of bar's i will be read. If you update it in foo,
> > then the value of foo's i will be used.
> >
> > So while for fixed varobj's update fetches new value of 'i', for floating varobjs
> > we also decide which 'i' to use each time.
>
> Eli,
> does the above make the code behaviour clear enough for you to suggest better doc
> working, or you want something else clarified?

Sorry, I somehow was certain I replied to you back then, but I see now
that I didn't.

More to the point, I cannot say that I have a clear understanding of
the issue. In what other situations will fixed and floating varobjs
behave differently? Are we talking about any situation where
identically named variables have different binding to memory
addresses, depending on scope and context? Like, for example,
identically named members of different C++ classes? Or are we talking
about something else?

Also, why does such behavior make sense? That is, why would I want an
object whose value depends on semi-random factors? E.g., if the
inferior stopped at a watchpoint, the context is unpredictable, and
then so is the value of a floating varobj, if I understand you
correctly. How is this helpful?