diff options
author | Tom Tromey <tom@tromey.com> | 2021-03-08 07:27:57 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2021-03-08 07:28:15 -0700 |
commit | 247d935b83da28edeb0894f5425190d92a2e786a (patch) | |
tree | 0c3bf7ea184e1bd4cc60df691d8f1ce24f107ea8 /gdb/expop.h | |
parent | 176793957a9892b6632710d505873eba43b35223 (diff) | |
download | gdb-247d935b83da28edeb0894f5425190d92a2e786a.zip gdb-247d935b83da28edeb0894f5425190d92a2e786a.tar.gz gdb-247d935b83da28edeb0894f5425190d92a2e786a.tar.bz2 |
Introduce last_operation
This adds class last_operation, which implements OP_LAST.
gdb/ChangeLog
2021-03-08 Tom Tromey <tom@tromey.com>
* expop.h (class last_operation): New.
Diffstat (limited to 'gdb/expop.h')
-rw-r--r-- | gdb/expop.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gdb/expop.h b/gdb/expop.h index 8329bab..73b66bf 100644 --- a/gdb/expop.h +++ b/gdb/expop.h @@ -579,6 +579,24 @@ public: { return OP_FUNC_STATIC_VAR; } }; +class last_operation + : public tuple_holding_operation<int> +{ +public: + + using tuple_holding_operation::tuple_holding_operation; + + value *evaluate (struct type *expect_type, + struct expression *exp, + enum noside noside) override + { + return access_value_history (std::get<0> (m_storage)); + } + + enum exp_opcode opcode () const override + { return OP_LAST; } +}; + } /* namespace expr */ #endif /* EXPOP_H */ |