From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21951 invoked by alias); 3 Dec 2002 16:27:27 -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 21941 invoked from network); 3 Dec 2002 16:27:23 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by sources.redhat.com with SMTP; 3 Dec 2002 16:27:23 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 18JHlj-0005Xn-00; Tue, 03 Dec 2002 12:27:40 -0600 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 18JFtV-0002DJ-00; Tue, 03 Dec 2002 11:27:33 -0500 Date: Tue, 03 Dec 2002 08:27:00 -0000 From: Daniel Jacobowitz To: Michael Elizabeth Chastain Cc: gdb@sources.redhat.com Subject: Re: Another "ptype B" validity question Message-ID: <20021203162732.GA8100@nevyn.them.org> Mail-Followup-To: Michael Elizabeth Chastain , gdb@sources.redhat.com References: <200212031556.gB3Fuwb30282@duracef.shout.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200212031556.gB3Fuwb30282@duracef.shout.net> User-Agent: Mutt/1.5.1i X-SW-Source: 2002-12/txt/msg00053.txt.bz2 On Tue, Dec 03, 2002 at 09:56:58AM -0600, Michael Elizabeth Chastain wrote: > I'm seeing some new output from the "ptype" command when I use a new > version of the compiler. > > Here are some gdb.log excerpts. > > The first excerpt is fine: > > # gdb HEAD, gcc 3.2.1, binutils 2.13.1, stabs+ > ptype class B > type = class B : public A { > public: > int b; > int x; > > B & operator=(B const&); > B(B const&); > B(); > } > (gdb) PASS: gdb.c++/classes.exp: ptype class B > > The second excerpt raises an issue: > > # gdb HEAD, gcc HEAD, binutils 2.13.1, stabs+ > ptype class B > type = class B : public A { > public: > A; > int b; > int x; > > B & operator=(B const&); > B(B const&); > B(); > } > (gdb) FAIL: gdb.c++/classes.exp: ptype class B > > Note the "A" line. I suppose this is gdb's way of showing the > base class as a data member. > > My questions are: > > . What should gdb print for this ptype operation? Ideally? Without checking the source, I'd guess: type = class B : public A { public: int b; int x; } We do not have enough information to figure out that the constructors are artificial in stabs+, though. Lord, I've tried and tried - I can produce exactly the same debug output with artificial and explicit constructors. I had a couple of heuristics for this but they are never terribly reliable. > . If gdb does print the "A;" member, is that acceptable or not? > Note that this is a slightly different question! It is _not_ acceptable. I thought I'd gotten most of these but obviously I've missed some. Please do file a bug. > . More generally, what is the long term future of stabs+? Rotting in a dark pit somewhere? Seriously, we need to either accept limited C++ support with stabs, or make GCC emit Sun DBX style stabs which have enough information. And make GDB understand them since it doesn't right now. Since GCC 3.2 has changed the default to DWARF-2 this is a looooong way down my priority list! > I really need an answer for #2 so that I can decide whether to change > the test script or brandish the FAIL in a bug report. > > My view is that the test suite should be liberal about what it accepts > in the output of "ptype" as long as it is somehow correct and does not > mislead human users. In this case, I think that most C++ programmers > would understand the nature of the "A;" line, so I would like to > change classes.exp to accept it. Please don't. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer