From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19764 invoked by alias); 26 Feb 2003 00:15:40 -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 19749 invoked from network); 26 Feb 2003 00:15:40 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by 172.16.49.205 with SMTP; 26 Feb 2003 00:15:40 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 18nr7o-0000ES-00 for ; Tue, 25 Feb 2003 20:16:48 -0600 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 18npEX-0008NF-00 for ; Tue, 25 Feb 2003 19:15:37 -0500 Date: Wed, 26 Feb 2003 00:15:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sources.redhat.com Subject: Re: [patch/rfc] gdb.c++/templates.exp, pr gdb/1063 Message-ID: <20030226001536.GB31684@nevyn.them.org> Mail-Followup-To: gdb-patches@sources.redhat.com References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.1i X-SW-Source: 2003-02/txt/msg00679.txt.bz2 On Tue, Feb 25, 2003 at 03:44:05PM -0800, David Carlton wrote: > I'm starting to clean up FAILs and XFAILs in gdb.c++/templates.exp. I > see several (especially in DWARF-2), with various causes, and they're > kind of subtle, so I'll probably do multiple patches for this. > (Frankly, the whole file is full of HP'isms and regexps that I'm > suspicious of, but never mind that.) > > Anyways: there are 5 tests that were all originally XFAILed that all > exhibit the same behavior. Basically, there's a templated classes C, > with a few instantiations. Then the test does 'ptype C'. > > Right now, with GCC 3.1/DWARF-2, GDB arbitrarily picks one of the > instantiations and does ptype of that. (Though not always, as I > commented in PR gdb/1063.) With GCC 2.95.3/stabs+, however, GDB says > that there's no type in question. What the testsuite is requesting is > that GDB actually know that it's a templated type, and print out > something related to that. > > For example, say that C is: > > template > class C { > T x; > }; > > Then if you do 'ptype C', then in some circumstances, GDB will print > out the type of C, in some circumstances GDB won't print out > anything (presumably because it knows about the types C, C, > or whatever, but not about just C), and the test suite wants output > that looks like what I wrote above. Note that we can't print out the above in stabs or dwarf-2; neither of them puts the abstract type in the debug info, only the referenced type. DWARF-2 can say a bit more than it does now - specifically, that "int" is a template paramater for C - but "DWARF does not represent the generic template definition, but does represent each instantiation" according to the v3 draft. The reason we often print out one of the instantiations is because each C contains a nested typedef for C in the DWARF-2. We don't handle nested types right yet. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer