Introduce var_entry_value_operation
authorTom Tromey <tom@tromey.com>
Mon, 8 Mar 2021 14:27:57 +0000 (07:27 -0700)
committerTom Tromey <tom@tromey.com>
Mon, 8 Mar 2021 14:28:15 +0000 (07:28 -0700)
This adds class var_entry_value_operation, which implements
OP_VAR_ENTRY_VALUE.

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

* expop.h (class var_entry_value_operation): New.
* eval.c (eval_op_var_entry_value): No longer static.

gdb/ChangeLog
gdb/eval.c
gdb/expop.h

index 129a2383da8b873be1191dab022653975f11df9d..f35cb4babab372a1487865bf4e09aa9ef1ec86fb 100644 (file)
@@ -1,3 +1,8 @@
+2021-03-08  Tom Tromey  <tom@tromey.com>
+
+       * expop.h (class var_entry_value_operation): New.
+       * eval.c (eval_op_var_entry_value): No longer static.
+
 2021-03-08  Tom Tromey  <tom@tromey.com>
 
        * expression.h (class operation) <set_outermost>: New method.
index 85e67f3fb933d09c0f2ee7ab407a0cc397fd48e4..7645291a8017dc72811d81b7074482cc2e98e962 100644 (file)
@@ -1201,7 +1201,7 @@ eval_op_scope (struct type *expect_type, struct expression *exp,
 
 /* Helper function that implements the body of OP_VAR_ENTRY_VALUE.  */
 
-static struct value *
+struct value *
 eval_op_var_entry_value (struct type *expect_type, struct expression *exp,
                         enum noside noside, symbol *sym)
 {
index 345cac2997672b558fca4715df93e304adf9d5c0..033ea0b1f0c89b11ddb606656d78426b5051fb2e 100644 (file)
@@ -51,6 +51,9 @@ extern struct value *eval_op_var_msym_value (struct type *expect_type,
                                             bool outermost_p,
                                             minimal_symbol *msymbol,
                                             struct objfile *objfile);
+extern struct value *eval_op_var_entry_value (struct type *expect_type,
+                                             struct expression *exp,
+                                             enum noside noside, symbol *sym);
 
 namespace expr
 {
@@ -533,6 +536,25 @@ protected:
     override;
 };
 
+class var_entry_value_operation
+  : public tuple_holding_operation<symbol *>
+{
+public:
+
+  using tuple_holding_operation::tuple_holding_operation;
+
+  value *evaluate (struct type *expect_type,
+                  struct expression *exp,
+                  enum noside noside) override
+  {
+    return eval_op_var_entry_value (expect_type, exp, noside,
+                                   std::get<0> (m_storage));
+  }
+
+  enum exp_opcode opcode () const override
+  { return OP_VAR_ENTRY_VALUE; }
+};
+
 } /* namespace expr */
 
 #endif /* EXPOP_H */
This page took 0.030812 seconds and 4 git commands to generate.