From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Elizabeth Chastain To: chastain@cygnus.com, dberlin@redhat.com Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] testsuite/gdb.c++/ref-types.exp: use runto Date: Sat, 17 Mar 2001 14:37:00 -0000 Message-id: <200103172237.OAA02091@bosch.cygnus.com> X-SW-Source: 2001-03/msg00326.html Daniel Berlin writes: > I think I can come up with a better heuristic. > How bout i do a minimal symbol lookup on the address we think the > virtual function is at, and make sure it's the start of some real > function (and if you really want to go a bit further, i'll make sure > it's a function in the class, or it's base classes) That sounds good to me. In the virtfunc.cc case, the test script calls pAe->f(), but gdb actually calls VB::vvb, because it's using the wrong vtable. When gdb goes off the wire, it winds up reading out of some memory that's near the right memory. The vtables appear close to each other in memory so I think it will often pick a random word out of a random nearby vtable. Instead of, or in addition to, looking at the class membership, you could look at the function name. If the user calls "f", but gdb wants to call "vvb", then it's always wrong. Michael