This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] locate members in multiple-inheritance hierarchy
- From: Thomas Richter <thor at mail dot math dot tu-berlin dot de>
- To: gdb-patches at sourceware dot org
- Date: Sun, 26 Feb 2006 23:44:04 +0100 (CET)
- Subject: [PATCH] locate members in multiple-inheritance hierarchy
Hi folks,
sorry to say that gdb-6.4 has (just another) bug in locating class members in multiple-inheritance class
hierarchies. The bug seems to be in lookup_struct_elt_type(), gdbtypes.c, lines 1234ff.
Specifically, this code *aborts* the scan by means of "noerr" when detecting a subclass that
does not contain the member being searched for. However, it should instead continue to search
subclasses.
To fix this problem, replace the for-loop over base classes in gdbtypes.c, lines 1234 by
the following:
for (i = TYPE_N_BASECLASSES (type) - 1; i1 >= 0; i--)
{
struct type *t = check_typedef (TYPE_BASECLASS (type, i));
/* FIX: THOR (25.2.2006):
** must check for typedefs, must not error on first tried subclass.
*/
t = lookup_struct_elt_type (t , name, 1 /*noerr*/);
if (t != NULL)
{
return t;
}
}
So long,
Thomas