Introduce repeat_operation

This adds class repeat_operation, which implements BINOP_REPEAT.

gdb/ChangeLog
2021-03-08  Tom Tromey  <tom@tromey.com>

	* expop.h (class repeat_operation): New.
	* eval.c (eval_op_repeat): No longer static.  Remove "op"
	parameter.
	(evaluate_subexp_standard): Update.
	* ax-gdb.c (repeat_operation::do_generate_ax): New method.
This commit is contained in:
Tom Tromey 2021-03-08 07:27:57 -07:00
parent 46916f2bcb
commit d4eff4c122
4 changed files with 81 additions and 3 deletions

View file

@ -1732,9 +1732,9 @@ eval_op_leq (struct type *expect_type, struct expression *exp,
/* A helper function for BINOP_REPEAT. */
static struct value *
struct value *
eval_op_repeat (struct type *expect_type, struct expression *exp,
enum noside noside,
enum noside noside, enum exp_opcode op,
struct value *arg1, struct value *arg2)
{
if (noside == EVAL_SKIP)
@ -2946,7 +2946,7 @@ evaluate_subexp_standard (struct type *expect_type,
case BINOP_REPEAT:
arg1 = evaluate_subexp (nullptr, exp, pos, noside);
arg2 = evaluate_subexp (nullptr, exp, pos, noside);
return eval_op_repeat (expect_type, exp, noside, arg1, arg2);
return eval_op_repeat (expect_type, exp, noside, op, arg1, arg2);
case BINOP_COMMA:
evaluate_subexp (nullptr, exp, pos, noside);