Daniel Jacobowitz wrote: > On Sun, Dec 31, 2006 at 03:01:42AM +0300, Vladimir Prus wrote: >> @@ -1061,6 +1061,14 @@ varobj_update (struct varobj **varp, str >> if (new == NULL) >> { >> (*varp)->error = 1; >> + /* Also set the value to NULL, so that >> + when the value becomes valid in future, >> + -var-update notice the change. */ >> + if ((*varp)->value != NULL) >> + { >> + value_free ((*varp)->value); >> + (*varp)->value = NULL; >> + } >> return -1; >> } >> > > "in the future", "notices the change". Should we be doing this > everywhere that we set var->error (probably add a new helper to do > that)? There's about a half-dozen places. I believe this was the only place where we don't set value to NULL on errors. This reminded me that I wanted to remove var->error for quite some time -- it's used in a single place, and using 'value == NULL' to indicate error is quite as reasonable. What about the attached? - Volodya 2006-12-31 Daniel Jacobowitz Vladimir Prus Fix 'selected frame' varobjs. * varobj.c (struct varobj): Remove the error field. (varobj_set_value): Don't check var->error. (install_new_value): Don't set var->error. (varobj_update): Always pass the new value of the root via install_new_value. (create_child): Don't set error field. (new_variable): Likewise. (c_value_of_root): Always reevaluate the value of selected frame varobjs in the selected frame. Don't call reinit_frame_cache.