aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2021-03-08 07:27:57 -0700
committerTom Tromey <tom@tromey.com>2021-03-08 07:28:15 -0700
commit247d935b83da28edeb0894f5425190d92a2e786a (patch)
tree0c3bf7ea184e1bd4cc60df691d8f1ce24f107ea8
parent176793957a9892b6632710d505873eba43b35223 (diff)
downloadgdb-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.
-rw-r--r--gdb/ChangeLog4
-rw-r--r--gdb/expop.h18
2 files changed, 22 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 6e9779e..b237cad 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
2021-03-08 Tom Tromey <tom@tromey.com>
+ * expop.h (class last_operation): New.
+
+2021-03-08 Tom Tromey <tom@tromey.com>
+
* expop.h (class func_static_var_operation): New.
* eval.c (eval_op_func_static_var): No longer static.
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 */