aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorMichael Tiemann <tiemann@cygnus>1993-02-01 01:11:17 +0000
committerMichael Tiemann <tiemann@cygnus>1993-02-01 01:11:17 +0000
commitedf67bd18137953e9258f07a3474052e595a7524 (patch)
treef21719a69b21d4a856fd8b13bb1d4d5f030326c2 /gdb
parent271e50309b248dc25e9d44e3b21f5415182a62cf (diff)
downloadgdb-edf67bd18137953e9258f07a3474052e595a7524.zip
gdb-edf67bd18137953e9258f07a3474052e595a7524.tar.gz
gdb-edf67bd18137953e9258f07a3474052e595a7524.tar.bz2
* gdbtypes.c (fill_in_vptr_fieldno): Don't ignore the first
baseclass--we don't always inherit its virtual function table pointer.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/gdbtypes.c14
2 files changed, 14 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index a23403b..7cdbd40 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
Sun Jan 31 04:32:48 1993 Michael Tiemann (tiemann@rtl.cygnus.com)
+ * gdbtypes.c (fill_in_vptr_fieldno): Don't ignore the first
+ baseclass--we don't always inherit its virtual function table
+ pointer.
+
* eval.c (evaluate_subexp): In OP_FUNCALL case, adjust `this'
pointer correctly in case value_struct_elt moves it around.
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 5787179..4be115d 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -690,9 +690,9 @@ lookup_template_type (name, type, block)
return (SYMBOL_TYPE (sym));
}
-/* Given a type TYPE, lookup the type of the component of type named
- NAME.
- If NOERR is nonzero, return zero if NAME is not suitably defined. */
+/* Given a type TYPE, lookup the type of the component of type named NAME.
+ If NOERR is nonzero, return zero if NAME is not suitably defined.
+ If NAME is the name of a baseclass type, return that type. */
struct type *
lookup_struct_elt_type (type, name, noerr)
@@ -718,6 +718,9 @@ lookup_struct_elt_type (type, name, noerr)
check_stub_type (type);
+ if (STREQ (type_name_no_tag (type), name))
+ return type;
+
for (i = TYPE_NFIELDS (type) - 1; i >= TYPE_N_BASECLASSES (type); i--)
{
char *t_field_name = TYPE_FIELD_NAME (type, i);
@@ -765,7 +768,10 @@ fill_in_vptr_fieldno (type)
if (TYPE_VPTR_FIELDNO (type) < 0)
{
int i;
- for (i = 1; i < TYPE_N_BASECLASSES (type); i++)
+
+ /* We must start at zero in case the first (and only) baseclass is
+ 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)