From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24710 invoked by alias); 2 Jul 2003 16:49:22 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 24699 invoked from network); 2 Jul 2003 16:49:22 -0000 Received: from unknown (HELO concert.shout.net) (204.253.184.25) by sources.redhat.com with SMTP; 2 Jul 2003 16:49:22 -0000 Received: from duracef.shout.net (duracef.shout.net [204.253.184.12]) by concert.shout.net (8.12.9/8.12.9) with ESMTP id h62GnKEb011376; Wed, 2 Jul 2003 11:49:20 -0500 Received: from duracef.shout.net (localhost [127.0.0.1]) by duracef.shout.net (8.12.9/8.12.9) with ESMTP id h62GnKHK026006; Wed, 2 Jul 2003 11:49:20 -0500 Received: (from mec@localhost) by duracef.shout.net (8.12.9/8.12.9/Submit) id h62GnKLW026005; Wed, 2 Jul 2003 12:49:20 -0400 Date: Wed, 02 Jul 2003 16:49:00 -0000 From: Michael Elizabeth Chastain Message-Id: <200307021649.h62GnKLW026005@duracef.shout.net> To: carlton@kealia.com Subject: Re: [patch/testsuite] gdb.c++/classes.exp: add another ptype pattern Cc: gdb-patches@sources.redhat.com X-SW-Source: 2003-07/txt/msg00037.txt.bz2 Ah, yeah, the problem with my questions is that they are at the end of a pipeline with several stages. Let's back up and look at what gcc outputs. I made a small source file: class ClassWithEnum { public: enum PrivEnum { red, green, blue, yellow = 42 }; PrivEnum priv_enum; int x; }; Then I hit it with gcc 3.2.3, and gcc 3.3 and diff'ed the .s files. - .stabs "PrivEnum:t(1,1)=ered:0,green:1,blue:2,yellow:42,;",128,0,4,0 + .stabs "ClassWithEnum::PrivEnum:t(1,1)=ered:0,green:1,blue:2,yellow:42,;",128,0,4,0 .stabs "ClassWithEnum:Tt(1,2)=s8priv_enum:(1,1),0,32;x:(0,1),32,32;operator=::(1,3)=#(1,2),(1,4)=&(1,2),(1,5)=*(1,2),(1,6)=&(1,7)=k(1,2),(1,8)=(1,8);:_ZN13ClassWithEnumaSERKS_;2A.;__base_ctor::(1,9)=#(1,2),(1,8),(1,5),(1,6),(1,8);:_ZN13ClassWithEnumC2ERKS_;2A.;__comp_ctor::(1,9):_ZN13ClassWithEnumC1ERKS_;2A.;__base_ctor::(1,10)=#(1,2),(1,8),(1,5),(1,8);:_ZN13ClassWithEnumC2Ev;2A.;__comp_ctor::(1,10):_ZN13ClassWithEnumC1Ev;2A.;;",128,0,2,0 The big stab for ClassWithEnum is the same, but the stab for the nested enum changed from 'PrivEnum' to 'ClassWithEnum::PrivEnum'. The hypothetical case has came to life. Argh! Is it good for us that gcc 3.3 and later versions output 'ClassWithEnum::PrivEnum'? Or should I file a bug report against gcc and ask them to put it back to just plain 'PrivEnum'? dc> I think that Daniel has a vision where this eventually becomes a dc> PASS. But that's a longer-term goal: if it become a PASS, it will do dc> so for a two-stage reason, where GDB knows that the type in question dc> is _really_ ClassWithEnum::PrivEnum but where the printer is clever dc> enough to know that, while we're printing out ClassWithEnum, we can dc> omit ClassWithEnum:: prefixes. Ah, I see. So it's hard to write the test case at this point. But it's done the job of alerting us to a difference in gcc output. Michael C