This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
printing VTT pointer?
- From: Michael Elizabeth Chastain <mec at shout dot net>
- To: carlton at kealia dot com, drow at mvista dot com, gdb at sources dot redhat dot com
- Date: Sun, 29 Jun 2003 13:25:19 -0400
- Subject: printing VTT pointer?
I'm chasing down some regressions from gcc 3.2.2 to gcc 3.3.
There are three C++ stabs+ scripts with regressions.
Here's a difference from inherit.exp.
The class definitions are:
class vA { public: int va; int vc; };
class vB : public virtual vA { public: int vb; int vx; };
vB g_vB;
And the output from five different compilers is:
# gcc 2.95.3 -gstabs+
print g_vB^M
$73 = {<vA> = {va = 3, vx = 4}, _vb$vA = 0x804970c, vb = 5, vx = 6}^M
(gdb) PASS: gdb.c++/inherit.exp: print g_vB
# gcc 3.2.3 -gstabs+
print g_vB^M
$73 = {<vA> = {va = 3, vx = 4}, _vptr.vB = 0x804fe6c, vb = 5, vx = 6}^M
(gdb) PASS: gdb.c++/inherit.exp: print g_vB (FIXME v3 vtbl ptr)
# gcc 3.3 -gstabs+
print g_vB^M
$73 = {<vA> = {va = 3, vx = 4}, _vptr.vB = 0x804ea74 <VTT for vB>, vb = 5, vx = 6}^M
(gdb) FAIL: gdb.c++/inherit.exp: print g_vB
# gcc gcc-3_3-branch -gstabs+
print g_vB^M
$73 = {<vA> = {va = 3, vx = 4}, _vptr.vB = 0x804eab4 <VTT for vB>, vb = 5, vx = 6}^M
(gdb) FAIL: gdb.c++/inherit.exp: print g_vB
# gcc HEAD -gstabs+
print g_vB^M
$73 = {<vA> = {va = 3, vx = 4}, _vptr.vB = 0x8094bac, vb = 5, vx = 6}^M
(gdb) PASS: gdb.c++/inherit.exp: print g_vB (FIXME v3 vtbl ptr)
Sometimes gdb does not print a VTT, and sometimes gdb prints a VTT.
When it does print a VTT, the value is correct (it matches what I see
with x/w in the right location).
The VTT goes away again with gcc HEAD, which is annoying.
What's the right thing for the test script to expect? Should it require
the "<VTT for vB>" output? Or should it accept the output with or
without "<VTT for vb>"? Or is it actually correctly written, as is,
where it forbids "<VTT for vB>"?
Michael C