I've noticed that the -var-show-references returns 'attr=noneditable' for structures, but 'attr=editable' for references to structures, which makes no sense. This patch fixes this. Some clarification is is order. Each varobj has three types associated with it. One type is the declared type in the source program. Second type is the type of the value we're actually storing. Third type is the type of value we're operating with when getting children. To be more concrete, first type is the type in program, no changes at all. Second type is type in program with top-level reference stripped. Third type also has top-level pointer dereferenced. This patch introduces, explicitly, a function to get the second type and makes c_variable_ediatable use it. OK? - Volodya Fix the 'editable' attribute computation for references. testsuite/ * gdb.mi/mi-var-cp.exp: Run the reference_to_struct testcase. * gdb.mi/mi-var-cp.cc (reference_to_struct): New function. (main): Call the above. gdb/ * varobj.c (get_value_type): New function. (c_variable_editable): Use get_value_type.