Introduce unop_ind_operation

This adds class unop_ind_operation, which implements UNOP_IND.

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

	* expop.h (class unop_ind_base_operation)
	(class unop_ind_operation): New.
	* eval.c (eval_op_ind): No longer static.  Remove "op" parameter.
	(unop_ind_base_operation::evaluate_for_address)
	(unop_ind_base_operation::evaluate_for_sizeof): New method.
	* ax-gdb.c (gen_expr_unop) <case UNOP_IND>: New.
This commit is contained in:
Tom Tromey 2021-03-08 07:27:57 -07:00
parent 6d89e2962a
commit 876469ffa1
4 changed files with 111 additions and 5 deletions

View file

@ -2736,6 +2736,14 @@ gen_expr_unop (struct expression *exp,
gen_complement (ax, value);
break;
case UNOP_IND:
lhs->generate_ax (exp, ax, value);
gen_usual_unary (ax, value);
if (!pointer_type (value->type))
error (_("Argument of unary `*' is not a pointer."));
gen_deref (value);
break;
default:
gdb_assert_not_reached ("invalid case in gen_expr_unop");
}