This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: -var-update @
> So, we still don't know why the current code does not work? I think
> we still get to figure out, to make sure that whatever bug there is
> does not affect other cases.
My patch didn't do the right thing (it always marked a floating variable
object as changed) but it's along the right lines. How about this one?
--
Nick http://www.inet.net.nz/~nickrob
2008-03-30 Nick Roberts <nickrob@snap.net.nz>
* varobj.c (value_of_root): Update expression of root for
floating variable objects.
*** varobj.c.~1.108.~ 2008-03-27 08:02:16.000000000 +1200
--- varobj.c 2008-03-30 15:41:44.000000000 +1200
*************** varobj_update (struct varobj **varp, str
*** 1739,1744 ****
--- 1739,1751 ----
new_type = varobj_get_type (tmp_var);
if (strcmp (old_type, new_type) == 0)
{
+ struct expression *tmp_exp;
+
+ /* Update expression to new frame. */
+ tmp_exp = var->root->exp;
+ var->root->exp = tmp_var->root->exp;
+ tmp_var->root->exp = tmp_exp;
+
varobj_delete (tmp_var, NULL, 0);
*type_changed = 0;
}