diff options
author | Per Bothner <per@bothner.com> | 1991-11-06 01:08:21 +0000 |
---|---|---|
committer | Per Bothner <per@bothner.com> | 1991-11-06 01:08:21 +0000 |
commit | 545af6ce070ded76ef1b8697495a18dbe0990e6c (patch) | |
tree | 6ee06fb285b476377d97fa7a7e8becdaf012e44f /gdb/values.c | |
parent | 4906534f1f4f6c1a3444f370cfd9ecdf986e66a0 (diff) | |
download | gdb-545af6ce070ded76ef1b8697495a18dbe0990e6c.zip gdb-545af6ce070ded76ef1b8697495a18dbe0990e6c.tar.gz gdb-545af6ce070ded76ef1b8697495a18dbe0990e6c.tar.bz2 |
Add C++ as a separate language.
Also, fix a C++ problem when looking for methods in super-classes.
(There was confusion between base and derived types.)
Diffstat (limited to 'gdb/values.c')
-rw-r--r-- | gdb/values.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/gdb/values.c b/gdb/values.c index a5b2c69..a7f959e 100644 --- a/gdb/values.c +++ b/gdb/values.c @@ -879,21 +879,23 @@ value_field (arg1, fieldno) return value_primitive_field (arg1, 0, fieldno, VALUE_TYPE (arg1)); } +/* Return a non-virtual function as a value. + F is the list of member functions which contains the desired method. + J is an index into F which provides the desired method. */ + value -value_fn_field (arg1, fieldno, subfieldno) - register value arg1; - register int fieldno; - int subfieldno; +value_fn_field (f, j) + struct fn_field *f; + int j; { register value v; - struct fn_field *f = TYPE_FN_FIELDLIST1 (VALUE_TYPE (arg1), fieldno); - register struct type *type = TYPE_FN_FIELD_TYPE (f, subfieldno); + register struct type *type = TYPE_FN_FIELD_TYPE (f, j); struct symbol *sym; - sym = lookup_symbol (TYPE_FN_FIELD_PHYSNAME (f, subfieldno), + sym = lookup_symbol (TYPE_FN_FIELD_PHYSNAME (f, j), 0, VAR_NAMESPACE, 0, NULL); if (! sym) error ("Internal error: could not find physical method named %s", - TYPE_FN_FIELD_PHYSNAME (f, subfieldno)); + TYPE_FN_FIELD_PHYSNAME (f, j)); v = allocate_value (type); VALUE_ADDRESS (v) = BLOCK_START (SYMBOL_BLOCK_VALUE (sym)); |