aboutsummaryrefslogtreecommitdiff
path: root/gdb/expop.h
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:16 -0700
commite6e01e16c547b21be2e3fc6b0783492aea98c427 (patch)
tree8c2fb58588c9f9bcd0d8a3f70693de97ea3d6041 /gdb/expop.h
parente6985c5e45ef0693005e21a25d847baf0f93c965 (diff)
downloadgdb-e6e01e16c547b21be2e3fc6b0783492aea98c427.zip
gdb-e6e01e16c547b21be2e3fc6b0783492aea98c427.tar.gz
gdb-e6e01e16c547b21be2e3fc6b0783492aea98c427.tar.bz2
Introduce internalvar_operation
This adds class internalvar_operation, which implements OP_INTERNALVAR. gdb/ChangeLog 2021-03-08 Tom Tromey <tom@tromey.com> * expop.h (class internalvar_operation): New. * ax-gdb.c (internalvar_operation::do_generate_ax): New method.
Diffstat (limited to 'gdb/expop.h')
-rw-r--r--gdb/expop.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/gdb/expop.h b/gdb/expop.h
index 44098b8..d143815 100644
--- a/gdb/expop.h
+++ b/gdb/expop.h
@@ -649,6 +649,38 @@ public:
{ return true; }
};
+class internalvar_operation
+ : public tuple_holding_operation<internalvar *>
+{
+public:
+
+ using tuple_holding_operation::tuple_holding_operation;
+
+ value *evaluate (struct type *expect_type,
+ struct expression *exp,
+ enum noside noside) override
+ {
+ return value_of_internalvar (exp->gdbarch,
+ std::get<0> (m_storage));
+ }
+
+ internalvar *get_internalvar () const
+ {
+ return std::get<0> (m_storage);
+ }
+
+ enum exp_opcode opcode () const override
+ { return OP_INTERNALVAR; }
+
+protected:
+
+ void do_generate_ax (struct expression *exp,
+ struct agent_expr *ax,
+ struct axs_value *value,
+ struct type *cast_type)
+ override;
+};
+
} /* namespace expr */
#endif /* EXPOP_H */