This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: gdb.c++ testsuite 1.3: member_data_static.exp (resend)
- From: Benjamin Kosnik <bkoz at redhat dot com>
- To: Michael Elizabeth Chastain <mec at shout dot net>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Tue, 28 May 2002 09:03:31 -0700
- Subject: Re: gdb.c++ testsuite 1.3: member_data_static.exp (resend)
- Organization: Red Hat / Paris
- References: <200205272241.g4RMfCY07438@duracef.shout.net>
- Reply-to: bkoz at redhat dot com
> 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 = <optimized out>}
>
> (gdb) print test3
> $2 = {static data = <optimized out>}
... 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?
-benjamin