diff options
author | John Gilmore <gnu@cygnus> | 1992-09-10 00:07:06 +0000 |
---|---|---|
committer | John Gilmore <gnu@cygnus> | 1992-09-10 00:07:06 +0000 |
commit | 2640f7e13856f4115d1f955b076f11272f5f3da0 (patch) | |
tree | 8a6bd711d3b3168db97ddf3036ff9ff34d0bffc6 /gdb/valops.c | |
parent | 5148923360989fb54088f499e4b4cefd14088f9a (diff) | |
download | gdb-2640f7e13856f4115d1f955b076f11272f5f3da0.zip gdb-2640f7e13856f4115d1f955b076f11272f5f3da0.tar.gz gdb-2640f7e13856f4115d1f955b076f11272f5f3da0.tar.bz2 |
Removed a large number of changes inserted by Per Bothner
for C++ support. These will go back in when they've been
examined.
Diffstat (limited to 'gdb/valops.c')
-rw-r--r-- | gdb/valops.c | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/gdb/valops.c b/gdb/valops.c index 791b097..a1ba919 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -43,7 +43,7 @@ static value search_struct_field PARAMS ((char *, value, int, struct type *, int)); static value -search_struct_method PARAMS ((char *, value *, value *, int, int *, +search_struct_method PARAMS ((char *, value, value *, int, int *, struct type *)); static int @@ -1038,7 +1038,6 @@ search_struct_field (name, arg1, offset, type, looking_for_baseclass) if (BASETYPE_VIA_VIRTUAL (type, i)) { value v2; - /* Fix to use baseclass_offset instead. FIXME */ baseclass_addr (type, i, VALUE_CONTENTS (arg1) + offset, &v2, (int *)NULL); if (v2 == 0) @@ -1066,9 +1065,9 @@ search_struct_field (name, arg1, offset, type, looking_for_baseclass) If found, return value, else return NULL. */ static value -search_struct_method (name, arg1p, args, offset, static_memfuncp, type) +search_struct_method (name, arg1, args, offset, static_memfuncp, type) char *name; - register value *arg1p, *args; + register value arg1, *args; int offset, *static_memfuncp; register struct type *type; { @@ -1093,10 +1092,10 @@ search_struct_method (name, arg1p, args, offset, static_memfuncp, type) TYPE_FN_FIELD_ARGS (f, j), args)) { if (TYPE_FN_FIELD_VIRTUAL_P (f, j)) - return (value)value_virtual_fn_field (arg1p, f, j, type, offset); + return (value)value_virtual_fn_field (arg1, f, j, type); if (TYPE_FN_FIELD_STATIC_P (f, j) && static_memfuncp) *static_memfuncp = 1; - return (value)value_fn_field (arg1p, f, j, type, offset); + return (value)value_fn_field (f, j); } j--; } @@ -1105,27 +1104,25 @@ search_struct_method (name, arg1p, args, offset, static_memfuncp, type) for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--) { - value v; + value v, v2; int base_offset; if (BASETYPE_VIA_VIRTUAL (type, i)) { - base_offset = - baseclass_offset (type, i, *arg1p, offset); - if (base_offset == -1) + baseclass_addr (type, i, VALUE_CONTENTS (arg1) + offset, + &v2, (int *)NULL); + if (v2 == 0) error ("virtual baseclass botch"); + base_offset = 0; } else { + v2 = arg1; base_offset = TYPE_BASECLASS_BITPOS (type, i) / 8; } - v = search_struct_method (name, arg1p, args, base_offset + offset, + v = search_struct_method (name, v2, args, base_offset, static_memfuncp, TYPE_BASECLASS (type, i)); - if (v) - { -/* *arg1p = arg1_tmp;*/ - return v; - } + if (v) return v; } return NULL; } @@ -1196,7 +1193,7 @@ value_struct_elt (argp, args, name, static_memfuncp, err) if (destructor_name_p (name, t)) error ("Cannot get value of destructor"); - v = search_struct_method (name, argp, args, 0, static_memfuncp, t); + v = search_struct_method (name, *argp, args, 0, static_memfuncp, t); if (v == 0) { @@ -1213,9 +1210,8 @@ value_struct_elt (argp, args, name, static_memfuncp, err) if (!args[1]) { /* destructors are a special case. */ - return (value)value_fn_field (NULL, TYPE_FN_FIELDLIST1 (t, 0), - TYPE_FN_FIELDLIST_LENGTH (t, 0), - 0, 0); + return (value)value_fn_field (TYPE_FN_FIELDLIST1 (t, 0), + TYPE_FN_FIELDLIST_LENGTH (t, 0)); } else { @@ -1223,7 +1219,7 @@ value_struct_elt (argp, args, name, static_memfuncp, err) } } else - v = search_struct_method (name, argp, args, 0, static_memfuncp, t); + v = search_struct_method (name, *argp, args, 0, static_memfuncp, t); if (v == 0) { @@ -1418,7 +1414,7 @@ value_struct_elt_for_reference (domain, offset, curtype, name, intype) (lookup_reference_type (lookup_member_type (TYPE_FN_FIELD_TYPE (f, j), domain)), - METHOD_PTR_FROM_VOFFSET((LONGEST) TYPE_FN_FIELD_VOFFSET (f, j))); + (LONGEST) TYPE_FN_FIELD_VOFFSET (f, j)); } else { |