[mi] fix 'editable' attribute for references

Vladimir Prus ghost@cs.msu.su
Tue Jan 16 18:39:00 GMT 2007


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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: path_3_5_references__gdb_mainline.diff
Type: text/x-diff
Size: 3012 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20070116/154fba71/attachment.bin>


More information about the Gdb-patches mailing list