From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20477 invoked by alias); 28 May 2002 16:23:14 -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 20462 invoked from network); 28 May 2002 16:23:10 -0000 Received: from unknown (HELO branoic) (12.234.96.134) by sources.redhat.com with SMTP; 28 May 2002 16:23:10 -0000 Received: from drow by branoic with local (Exim 3.35 #1 (Debian)) id 17CjkN-0003Ql-00; Tue, 28 May 2002 12:22:55 -0400 Date: Tue, 28 May 2002 09:47:00 -0000 From: Daniel Jacobowitz To: Benjamin Kosnik Cc: Michael Elizabeth Chastain , gdb-patches@sources.redhat.com Subject: Re: gdb.c++ testsuite 1.3: member_data_static.exp (resend) Message-ID: <20020528162254.GA13157@branoic.them.org> Mail-Followup-To: Benjamin Kosnik , Michael Elizabeth Chastain , gdb-patches@sources.redhat.com References: <200205272241.g4RMfCY07438@duracef.shout.net> <20020528090331.5b74b2ae.bkoz@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020528090331.5b74b2ae.bkoz@redhat.com> User-Agent: Mutt/1.3.28i X-SW-Source: 2002-05/txt/msg00974.txt.bz2 On Tue, May 28, 2002 at 09:03:31AM -0700, Benjamin Kosnik wrote: > > > This test script has 6 FAILs in each configuration tested. > > > > FAIL: gdb.c++/m-static.exp: derived template object, static enum > > FAIL: gdb.c++/m-static.exp: template object, static const bool > > FAIL: gdb.c++/m-static.exp: template object, static const int > > FAIL: gdb.c++/m-static.exp: template object, static long > > FAIL: gdb.c++/m-static.exp: template object, static enum > > FAIL: gdb.c++/m-static.exp: template object, static enum > > That is what I get too. > > > Something in the toolchain is optimizing away unused static objects. > > Right. I need this to work as the testsuite is written please. > > > static value_derived = } > > > > (gdb) print test3 > > $2 = {static data = } > > ... which makes debugging C++ a pain in the ass, and the reason I sat > down and wrote this file. I consider gdb to be broken. Hopefully this > test case will facilitate a fix to the problem noted above. > > > This happens with both -gdwarf-2 and -gstabs+ on all gcc's and > > binutil's in my test bed. > > Me too. > > > I fixed this by adding references to the data fields, like this: > > > > refer(&test2.value_derived); > > refer(&test3.data); > > refer(&test3.data.value_derived); > > Errr. No, unless you expect everybody using gdb and C++ do to this as > well. In which case, you should put this in the FAQ. > > Is there something I am missing? Is the data truly optimized out of the file? If it is, then considering GDB to be broken doesn't help anything; the information isn't there to work with. On the other hand, if it isn't and GDB is not finding it, then that is a different problem and something worth testing. -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer