From 072bba3b0f3e2ee8d2cfc94e256d0f0ebc627afc Mon Sep 17 00:00:00 2001 From: Keith Seitz Date: Tue, 10 Nov 2009 22:17:58 +0000 Subject: * c-exp.y: Add new rule for resolving method overloads. * eval.c (make_params): New function. (free_param_types): New function. (evaluate_subexp_standard): Pass expect_type to value_aggregate_elt. Handle case TYPE_INSTANCE. (evaluate_subexp_for_address): Pass expect_type to value_aggregate_elt. * expression.h (enum exp_opcode): Add TYPE_INSTANCE. (compare_parameters): Add declaration. * parse.c (operator_length_standard): Add TYPE_INSTANCE. * valops.c (value_aggregate_elt): Add new expect_type parameter. Pass expect_type to value_struct_elt_for_reference. (value_struct_elt_for_reference): Add expect_type parameter and use compare_parameters. Check for overload matches with and without artificial parameters. Skip artificial methods. (compare_parameters): New function. * value.h (value_aggregate_elt): Add new expect_type parameter. --- gdb/parse.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gdb/parse.c') diff --git a/gdb/parse.c b/gdb/parse.c index ef938e3..ef61146 100644 --- a/gdb/parse.c +++ b/gdb/parse.c @@ -837,6 +837,11 @@ operator_length_standard (struct expression *expr, int endpos, args = 1 + longest_to_int (expr->elts[endpos - 2].longconst); break; + case TYPE_INSTANCE: + oplen = 4 + longest_to_int (expr->elts[endpos - 2].longconst); + args = 1; + break; + case OP_OBJC_MSGCALL: /* Objective C message (method) call */ oplen = 4; args = 1 + longest_to_int (expr->elts[endpos - 2].longconst); -- cgit v1.1