aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2002-10-02 22:01:53 +0000
committerDaniel Jacobowitz <drow@false.org>2002-10-02 22:01:53 +0000
commitcef4f5dd72bc84b609f3cb472e20fbfdc79c65c6 (patch)
tree55ffe9de3704bd33bd621b3a3d55b3a4a55bab0f
parentad050da3e600d5e99781d0ad96fa9281ae38778c (diff)
downloadgdb-cef4f5dd72bc84b609f3cb472e20fbfdc79c65c6.zip
gdb-cef4f5dd72bc84b609f3cb472e20fbfdc79c65c6.tar.gz
gdb-cef4f5dd72bc84b609f3cb472e20fbfdc79c65c6.tar.bz2
Fix PR gdb/778
* gdbtypes.c (fill_in_vptr_fieldno): Call check_typedef before recursing. * gnu-v3-abi.c (gnuv3_virtual_fn_field): Check return value of fill_in_vptr_fieldno.
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/gdbtypes.c11
-rw-r--r--gdb/gnu-v3-abi.c3
3 files changed, 16 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 6068879..b2c884f2 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,11 @@
+2002-10-02 Daniel Jacobowitz <drow@mvista.com>
+
+ Fix PR gdb/778
+ * gdbtypes.c (fill_in_vptr_fieldno): Call check_typedef
+ before recursing.
+ * gnu-v3-abi.c (gnuv3_virtual_fn_field): Check return value
+ of fill_in_vptr_fieldno.
+
2002-10-02 Elena Zannoni <ezannoni@redhat.com>
* inferior.h (registers_info, stepi_command, nexti_command,
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 4022394..3ef1828 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -1276,13 +1276,12 @@ fill_in_vptr_fieldno (struct type *type)
virtual (and hence we cannot share the table pointer). */
for (i = 0; i < TYPE_N_BASECLASSES (type); i++)
{
- fill_in_vptr_fieldno (TYPE_BASECLASS (type, i));
- if (TYPE_VPTR_FIELDNO (TYPE_BASECLASS (type, i)) >= 0)
+ struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i));
+ fill_in_vptr_fieldno (baseclass);
+ if (TYPE_VPTR_FIELDNO (baseclass) >= 0)
{
- TYPE_VPTR_FIELDNO (type)
- = TYPE_VPTR_FIELDNO (TYPE_BASECLASS (type, i));
- TYPE_VPTR_BASETYPE (type)
- = TYPE_VPTR_BASETYPE (TYPE_BASECLASS (type, i));
+ TYPE_VPTR_FIELDNO (type) = TYPE_VPTR_FIELDNO (baseclass);
+ TYPE_VPTR_BASETYPE (type) = TYPE_VPTR_BASETYPE (baseclass);
break;
}
}
diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c
index fbab8af..2b4e01a 100644
--- a/gdb/gnu-v3-abi.c
+++ b/gdb/gnu-v3-abi.c
@@ -324,6 +324,9 @@ gnuv3_virtual_fn_field (struct value **value_p,
type now. */
if (TYPE_VPTR_FIELDNO (vfn_base) < 0)
fill_in_vptr_fieldno (vfn_base);
+ if (TYPE_VPTR_FIELDNO (vfn_base) < 0)
+ error ("Could not find virtual table pointer for class \"%s\".",
+ TYPE_TAG_NAME (vfn_base) ? TYPE_TAG_NAME (vfn_base) : "<unknown>");
/* Now that we know which base class is defining our virtual
function, cast our value to that baseclass. This takes care of