Implement some Ada OP_ATR_ operations

This implements a few Ada OP_ATR_ operations.

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

	* ada-lang.c (ada_unop_atr_operation::evaluate): New method.
	* ada-exp.h (class ada_unop_atr_operation): New.
This commit is contained in:
Tom Tromey 2021-03-08 07:27:57 -07:00
parent 82c3886e24
commit 60fa02ca6f
3 changed files with 42 additions and 0 deletions

View file

@ -10532,6 +10532,27 @@ ada_binop_addsub_operation::evaluate (struct type *expect_type,
return arg1;
}
value *
ada_unop_atr_operation::evaluate (struct type *expect_type,
struct expression *exp,
enum noside noside)
{
struct type *type_arg = nullptr;
value *val = nullptr;
if (std::get<0> (m_storage)->opcode () == OP_TYPE)
{
value *tem = std::get<0> (m_storage)->evaluate (nullptr, exp,
EVAL_AVOID_SIDE_EFFECTS);
type_arg = value_type (tem);
}
else
val = std::get<0> (m_storage)->evaluate (nullptr, exp, noside);
return ada_unop_atr (exp, noside, std::get<1> (m_storage),
val, type_arg, std::get<2> (m_storage));
}
}
/* Implement the evaluate_exp routine in the exp_descriptor structure