diff options
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/expop.h | 22 |
2 files changed, 26 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 0633260..9acaee4 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,9 @@ 2021-03-08 Tom Tromey <tom@tromey.com> + * expop.h (class bool_operation): New. + +2021-03-08 Tom Tromey <tom@tromey.com> + * expop.h (class register_operation): New. * eval.c (eval_op_register): No longer static. * ax-gdb.c (register_operation::do_generate_ax): New method. diff --git a/gdb/expop.h b/gdb/expop.h index a0e0030..44098b8 100644 --- a/gdb/expop.h +++ b/gdb/expop.h @@ -627,6 +627,28 @@ protected: override; }; +class bool_operation + : public tuple_holding_operation<bool> +{ +public: + + using tuple_holding_operation::tuple_holding_operation; + + value *evaluate (struct type *expect_type, + struct expression *exp, + enum noside noside) override + { + struct type *type = language_bool_type (exp->language_defn, exp->gdbarch); + return value_from_longest (type, std::get<0> (m_storage)); + } + + enum exp_opcode opcode () const override + { return OP_BOOL; } + + bool constant_p () const override + { return true; } +}; + } /* namespace expr */ #endif /* EXPOP_H */ |