This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [ob] Adjust member pointer test for g++ 3.3
On Fri, Jan 12, 2007 at 10:50:27PM +0100, Mark Kettenis wrote:
> The test now runs for me, but I get quite a few errors. Here's the
> resulting bit from gdb.log. Can you spot what's going wromg here?
> Should we XFAIL this test for GCC 3.3?
That depends how we got to some of these bogus conclusions. I filed
a GCC bug for the lousy debug info it emits for member pointers; until
that's fixed, though, I added a workaround in dwarf2read.c. If there's
an easy way to extend that to match this too, then it may be helpful to
do so.
Do OpenBSD 3.x toolchains use dwarf2? Or is this out in stabs land?
> ptype pmi
> type = int A::**
> (gdb) FAIL: gdb.cp/member-ptr.exp: ptype pmi (A::j)
It should be "int A::*". Somehow we think we have a pointer to a
member pointer, instead of just a member pointer. That explains most
of the cascading failures for pmi.
> print a.*pmf
> $9 = {int (A *, int)} 0x1c000af6 <A::bar(int)>
> (gdb) PASS: gdb.cp/member-ptr.exp: print a.*pmf
We get this right...
> print (a.*pmf)(3)
> $11 = 127
> (gdb) FAIL: gdb.cp/member-ptr.exp: print (a.*pmf)(3)
So I'm pretty surprised that we get this wrong. We've somehow called
the wrong function, or called it with a bogus argument / "this" pointer.
All the failures except for this one are caused by the strange type
of pointers to data members.
--
Daniel Jacobowitz
CodeSourcery