Index: c-valprint.c =================================================================== RCS file: /cvs/src/src/gdb/c-valprint.c,v retrieving revision 1.39 diff -u -r1.39 c-valprint.c --- c-valprint.c 18 Jan 2006 21:24:19 -0000 1.39 +++ c-valprint.c 4 Apr 2006 07:09:25 -0000 @@ -356,11 +356,6 @@ print_scalar_formatted (valaddr + embedded_offset, type, format, 0, stream); break; } - /* FIXME, we should consider, at least for ANSI C language, eliminating - the distinction made between FUNCs and POINTERs to FUNCs. */ - fprintf_filtered (stream, "{"); - type_print (type, "", stream, -1); - fprintf_filtered (stream, "} "); /* Try to print what function it points to, and its address. */ print_address_demangle (address, stream, demangle); break; @@ -570,6 +565,16 @@ } } + if (TYPE_CODE (type) == TYPE_CODE_FUNC) + { + /* FIXME, we should consider, at least for ANSI C language, eliminating + the distinction made between FUNCs and POINTERs to FUNCs. */ + fprintf_filtered (stream, "{"); + type_print (type, "", stream, -1); + fprintf_filtered (stream, "} "); + } + + if (objectprint && (TYPE_CODE (type) == TYPE_CODE_CLASS)) { /* Attempt to determine real type of object */ Index: testsuite/gdb.mi/mi-var-cmd.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.mi/mi-var-cmd.exp,v retrieving revision 1.18 diff -u -r1.18 mi-var-cmd.exp --- testsuite/gdb.mi/mi-var-cmd.exp 14 Jan 2005 18:17:19 -0000 1.18 +++ testsuite/gdb.mi/mi-var-cmd.exp 4 Apr 2006 07:09:26 -0000 @@ -560,6 +560,15 @@ mi_gdb_test "-var-update selected_a" \ "\\^done,changelist=\\\[\{name=\"selected_a\",in_scope=\"true\",new_type=\"int\",new_num_children=\"0\"\}\\\]" \ "update selected_a in do_special_tests" + +mi_gdb_test "-var-create function * *f " \ + "\\^done,name=\"function\",numchild=\"0\",type=\"void \\(\\)\"" \ + "create varobj for function variable" + +mi_gdb_test "-var-evaluate-expression function" \ + "\\^done,value=\"0x.*\"" \ + "print value of function object" + mi_gdb_exit return 0