=== gdb/varobj.c ================================================================== --- gdb/varobj.c (revision 2144) +++ gdb/varobj.c (local) @@ -507,11 +507,9 @@ /* We definitively need to catch errors here. If evaluate_expression succeeds we got the value we wanted. But if it fails, we still go on with a call to evaluate_type() */ - if (gdb_evaluate_expression (var->root->exp, &value)) - { - /* no error */ - } - else + if (!gdb_evaluate_expression (var->root->exp, &value)) + /* Error getting the value. Try to at least get the + right type. */ value = evaluate_type (var->root->exp); release_value (value); @@ -837,20 +835,19 @@ /* Need to coerce the input. We want to check if the value of the variable object will be different after assignment, and the first thing value_assign - does is coercing the input. - For example, it means that if assigning array to - a pointer variable, we'll be comparing pointer with array's - address, not pointer with array's content. */ + does is coerce the input. + For example, if we are assigning an array to a pointer variable we + should compare the pointer with the the array's address, not with the + array's content. */ value = coerce_array (value); if (!value_contents_equal (var->value, value)) var->updated = 1; - /* The new value may be lazy. gdb_value_assign, or - 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. */ + /* The new value may be lazy. gdb_value_assign, or + rather value_contents, will take care of this. + If fetching of the new value will fail, gdb_value_assign + with catch the exception. */ if (!gdb_value_assign (var->value, value, &val)) return 0; value_free (var->value); @@ -900,7 +897,7 @@ and return 0. Otherwise, assign the value and if type_changeable returns non-zero, find if the new value is different from the current value. - Return 1 if so, and 0 is the values are equal. */ + Return 1 if so, and 0 if the values are equal. */ static int install_new_value (struct varobj *var, struct value *value, int initial) { @@ -979,7 +976,7 @@ } } - /* We must always keep the new value, since children depend on it. */ + /* We must always keep the new value, since children depend on it. */ if (var->value != NULL) value_free (var->value); var->value = value;