From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12582 invoked by alias); 8 Jul 2005 08:02:08 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 12408 invoked by uid 22791); 8 Jul 2005 08:01:48 -0000 Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Fri, 08 Jul 2005 08:01:48 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1DqnnD-0000Ht-Iq for gdb@sources.redhat.com; Fri, 08 Jul 2005 10:01:03 +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 ; Fri, 08 Jul 2005 10:01:03 +0200 Received: from ghost by zigzag.lvk.cs.msu.su with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 08 Jul 2005 10:01:03 +0200 To: gdb@sources.redhat.com From: Vladimir Prus Subject: Formatting of function pointer value Date: Fri, 08 Jul 2005 08:02:00 -0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit User-Agent: KNode/0.8.2 X-SW-Source: 2005-07/txt/msg00075.txt.bz2 Hello, consider the following snippet: B* p2 = (B*)0x12345678; int (*p3)(int) = (fp)0x000000AE; the value of p2 is printed like this: (gdb)info local .... p2 = (B *) 0xb8000540 the value of *p3 is printed like this: (gdb) print *p3 $1 = {int (int)} 0xb7ee6e9c <__DTOR_END__+4> I have a couple of questions: 1. Why in both cases the type of value is printed? There's already 'whatis' command. I've checked that code and it's printed unconditionally. As the result, a GDB frontend must strip the type. 2. Why the type is enclosed in parenthesis in the first case, and in braces in the second case? This entails additonal problems for GUI frontend, for example, at the moment KDevelop thinks that the opening brace in the second case starts a composite. - Volodya