From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3265 invoked by alias); 4 Apr 2006 07:18:35 -0000 Received: (qmail 3256 invoked by uid 22791); 4 Apr 2006 07:18:35 -0000 X-Spam-Check-By: sourceware.org Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 04 Apr 2006 07:18:32 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1FQfnt-0000vd-2w for gdb-patches@sources.redhat.com; Tue, 04 Apr 2006 09:18:17 +0200 Received: from zigzag.lvk.cs.msu.su ([158.250.17.23]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 04 Apr 2006 09:18:17 +0200 Received: from ghost by zigzag.lvk.cs.msu.su with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 04 Apr 2006 09:18:17 +0200 To: gdb-patches@sources.redhat.com From: Vladimir Prus Subject: Re: Remove type prefix for -var-evaluate-expression/functions Date: Tue, 04 Apr 2006 07:18:00 -0000 Message-ID: References: <17434.35140.456146.649459@kahikatea.snap.net.nz> <200603171319.55381.ghost@cs.msu.su> <20060317193702.GC19068@nevyn.them.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart1431528.3goENkcqd5" Content-Transfer-Encoding: 7Bit User-Agent: KNode/0.8.2 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-04/txt/msg00024.txt.bz2 --nextPart1431528.3goENkcqd5 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 8Bit Content-length: 1029 Daniel Jacobowitz wrote: >> > Well I guess mi-var-cmd.exp. Please remember that I'm not the >> > maintainer >> > but just an interested party. See what Daniel says. He might want >> > something for mi2-var-cmd.exp too. >> >> Ok, I'll wait for his comment. > > mi-var-cmd.exp sounds good to me. I don't think we need it in > mi2-var-cmd.exp. I have the same question I asked a moment ago about > Nick's patch - is there any chance that someone relies on this > information? > > Here I think the chance is pretty slim; for pointers it's a more > serious concern, but for functions this is a pretty rare case. > So not versioning this change makes sense to me. The new version of the patch, with testsuite change, is attached. Changelog: 2006-03-15 Vladimir Prus * c-valprint.c (c_val_print): Don't print type prefix for functions. (c_value_print): Print type prefix for functions here. * testsuite/gdb.mi/mi-var-cmd.exp: Test for new behaviour. - Volodya --nextPart1431528.3goENkcqd5 Content-Type: text/x-diff; name="type_prefix_2.diff" Content-Transfer-Encoding: 8Bit Content-Disposition: attachment; filename="type_prefix_2.diff" Content-length: 2168 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 --nextPart1431528.3goENkcqd5--