diff options
author | Daniel Jacobowitz <dan@debian.org> | 2002-01-04 17:51:38 +0000 |
---|---|---|
committer | Daniel Jacobowitz <dan@debian.org> | 2002-01-04 17:51:38 +0000 |
commit | a2d59c77282a07fb8822fb1630789c0ea7fb0e92 (patch) | |
tree | d00ca9232ee8c84eaecccd8b8c88242c2c936561 | |
parent | 07c283e92cf2e3d08ecbcb70faea09a4c68f752d (diff) | |
download | gdb-a2d59c77282a07fb8822fb1630789c0ea7fb0e92.tar.gz |
2002-01-04 Daniel Jacobowitz <drow@mvista.com>
* valops.c (find_overload_match): Accept obj as a
reference parameter. Update it before returning.
* value.h (find_overload_match): Update prototype.
* eval.c (evaluate_subexp_standard): Pass object to
find_overload_match by reference.
-rw-r--r-- | gdb/ChangeLog | 8 | ||||
-rw-r--r-- | gdb/eval.c | 2 | ||||
-rw-r--r-- | gdb/valops.c | 12 | ||||
-rw-r--r-- | gdb/value.h | 2 |
4 files changed, 21 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c7539f838ce..0f2c8354c64 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,11 @@ +2002-01-04 Daniel Jacobowitz <drow@mvista.com> + + * valops.c (find_overload_match): Accept obj as a + reference parameter. Update it before returning. + * value.h (find_overload_match): Update prototype. + * eval.c (evaluate_subexp_standard): Pass object to + find_overload_match by reference. + 2002-01-03 Andrew Cagney <ac131313@redhat.com> * valarith.c: Replace value_ptr with struct value pointer. Remove diff --git a/gdb/eval.c b/gdb/eval.c index a56ed84fb4a..3f5aca3733c 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -845,7 +845,7 @@ evaluate_subexp_standard (struct type *expect_type, (void) find_overload_match (arg_types, nargs, tstr, 1 /* method */ , 0 /* strict match */ , - arg2 /* the object */ , NULL, + &arg2 /* the object */ , NULL, &valp, NULL, &static_memfuncp); diff --git a/gdb/valops.c b/gdb/valops.c index cfc6937da00..dfef1131acc 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -2636,12 +2636,13 @@ value_find_oload_method_list (struct value **argp, char *method, int offset, int find_overload_match (struct type **arg_types, int nargs, char *name, int method, - int lax, struct value *obj, struct symbol *fsym, + int lax, struct value **objp, struct symbol *fsym, struct value **valp, struct symbol **symp, int *staticp) { int nparms; struct type **parm_types; int champ_nparms = 0; + struct value *obj = (objp ? *objp : NULL); short oload_champ = -1; /* Index of best overloaded function */ short oload_ambiguous = 0; /* Current ambiguity state for overload resolution */ @@ -2865,6 +2866,15 @@ find_overload_match (struct type **arg_types, int nargs, char *name, int method, xfree (func_name); } + if (objp) + { + if (TYPE_CODE (VALUE_TYPE (temp)) != TYPE_CODE_PTR + && TYPE_CODE (VALUE_TYPE (*objp)) == TYPE_CODE_PTR) + { + temp = value_addr (temp); + } + *objp = temp; + } return oload_incompatible ? 100 : (oload_non_standard ? 10 : 0); } diff --git a/gdb/value.h b/gdb/value.h index 006ec111715..a6a517ceb9c 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -388,7 +388,7 @@ extern struct fn_field *value_find_oload_method_list (struct value **, char *, extern int find_overload_match (struct type **arg_types, int nargs, char *name, int method, int lax, - struct value *obj, struct symbol *fsym, + struct value **objp, struct symbol *fsym, struct value **valp, struct symbol **symp, int *staticp); |