Daniel Jacobowitz wrote: >> + rather value_contents, will take care of this. >> + It might throw, but unlike var-update for -var-assign >> + there's just one variable we're working it, so we don't >> + need to catch the exception here. */ > > Wait, what? gdb_value_assign will never throw. value_contents > might, but gdb_value_assign will catch it. Yep, confused gdb_value_assign with value_assign. Updated patch attached. I also attach the delta to the previous patch. - Volodya Fetch values from memory in a single place, and only fetch the values that are really needed. * varobj.c (struct varobj): Clarify comment. (my_value_equal): Remove. (install_new_value): New function. (type_of_child): Remove. (varobj_create): Use install_new_value. (varobj_set_value): Use value_contents_equal, not my_value_equal. (varobj_update): Use install_new_value. (create_child): Likewise. Inline type_of_child here. (value_of_child): Don't fetch the value. (c_value_of_root): Likewise. (c_value_of_variable): Likewise. (type_changeable): Improve comments. gdb/testsuite/ * gdb.mi/mi-var-cmd.exp: Check -var-update after assignement of arrays and function pointers. * gdb.mi/var-cmd.c: Add declaration necessary for above tests.