aboutsummaryrefslogtreecommitdiff
path: root/gdb/eval.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-03-08 07:27:57 -0700
committerTom Tromey <tom@tromey.com>2021-03-08 07:28:19 -0700
commite51e26a090053f8f8354692fff6dce20ed2e47ba (patch)
tree9f703afaf461c5eaa05838e8e4b0b3843f89c09f /gdb/eval.c
parent07f724a8c604cdfa1639f757e577dd6eb9caed25 (diff)
downloadgdb-e51e26a090053f8f8354692fff6dce20ed2e47ba.zip
gdb-e51e26a090053f8f8354692fff6dce20ed2e47ba.tar.gz
gdb-e51e26a090053f8f8354692fff6dce20ed2e47ba.tar.bz2
Introduce concat_operation
This adds class concat_operation, which implements BINOP_CONCAT. gdb/ChangeLog 2021-03-08 Tom Tromey <tom@tromey.com> * expop.h (class concat_operation): New. * eval.c (eval_op_concat): No longer static. Remove "op" parameter. (evaluate_subexp_standard): Update.
Diffstat (limited to 'gdb/eval.c')
-rw-r--r--gdb/eval.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/gdb/eval.c b/gdb/eval.c
index de78631..b78fa3b 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -1313,15 +1313,14 @@ eval_op_objc_selector (struct type *expect_type, struct expression *exp,
/* Helper function that implements the body of BINOP_CONCAT. */
-static struct value *
+struct value *
eval_op_concat (struct type *expect_type, struct expression *exp,
- enum noside noside,
- enum exp_opcode op, struct value *arg1, struct value *arg2)
+ enum noside noside, struct value *arg1, struct value *arg2)
{
if (noside == EVAL_SKIP)
return eval_skip_value (exp);
- if (binop_user_defined_p (op, arg1, arg2))
- return value_x_binop (arg1, arg2, op, OP_NULL, noside);
+ if (binop_user_defined_p (BINOP_CONCAT, arg1, arg2))
+ return value_x_binop (arg1, arg2, BINOP_CONCAT, OP_NULL, noside);
else
return value_concat (arg1, arg2);
}
@@ -2791,7 +2790,7 @@ evaluate_subexp_standard (struct type *expect_type,
case BINOP_CONCAT:
arg1 = evaluate_subexp_with_coercion (exp, pos, noside);
arg2 = evaluate_subexp_with_coercion (exp, pos, noside);
- return eval_op_concat (expect_type, exp, noside, op, arg1, arg2);
+ return eval_op_concat (expect_type, exp, noside, arg1, arg2);
case BINOP_ASSIGN:
arg1 = evaluate_subexp (nullptr, exp, pos, noside);