From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24615 invoked by alias); 24 Nov 2004 18:04:05 -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 24423 invoked from network); 24 Nov 2004 18:03:13 -0000 Received: from unknown (HELO NUTMEG.CAM.ARTIMI.COM) (217.40.111.177) by sourceware.org with SMTP; 24 Nov 2004 18:03:13 -0000 Received: from mace ([192.168.1.25]) by NUTMEG.CAM.ARTIMI.COM with Microsoft SMTPSVC(6.0.3790.211); Wed, 24 Nov 2004 18:01:52 +0000 From: "Dave Korn" To: , Cc: Subject: RE: Struct fields printed in a strange way Date: Fri, 26 Nov 2004 17:26:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit In-Reply-To: <32856.210.18.132.234.1101319515.squirrel@webmail.codito.com> Message-ID: X-OriginalArrivalTime: 24 Nov 2004 18:01:52.0281 (UTC) FILETIME=[AD2C0890:01C4D24F] X-SW-Source: 2004-11/txt/msg00245.txt.bz2 > -----Original Message----- > From: gdb-owner On Behalf Of Ramana Radhakrishnan > Sent: 24 November 2004 18:05 > > gdb seems slightly confused when the name of a struct field is > > suffixed with "__0". > > > > $ cat foo.c > > struct foo { double x__0, y__0, z__1; } bar; > > > > int main(void) { return 0; } > > > > $ gcc-3.3.2 -Wall -ansi -pedantic -g3 foo.c > > I was able to repeat this with > > [ramana@numenor gdb]$ gcc -v > gcc version 3.3.2 20031022 (Red Hat Linux 3.3.2-1) > > and > > > GNU gdb 6.3.50_2004-11-23-cvs Also confirmed on cygwin with "gcc (GCC) 3.3.3 (cygwin special)" and "GNU gdb 2003-09-20-cvs (cygwin-special)" So it's a fairly longstanding bug. > > (gdb) show language > > The current source language is "auto; currently c". > > > > Why is x__0 changed to ::x(void)? Is the "__0" suffix > reserved in gdb? > > > This appears to be due to the way in which the structs are handled in > c-valprint.c . The demangler gets called here because the function > c_val_print prints the structure fields using the printer from the c++ > language implementation. Should there not be a C equivalent for this ? > This btw is from yesterday's CVS sources. That's definitely bad logic. I had noticed that even if you explicitly say "set lang c", it _still_ tries to demangle the name. Anyone going to file a bugzilla then? cheers, DaveK -- Can't think of a witty .sigline today....