aboutsummaryrefslogtreecommitdiff
path: root/gdb/c-exp.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:17 -0700
commit09db3700263c5e614768126d000b55e5df28f460 (patch)
tree1eff1a0e2a48428483137bc589961bb09e87a1f4 /gdb/c-exp.h
parent06dc61b9dfe5f76740b46be8f6e61ea699268fb1 (diff)
downloadbinutils-09db3700263c5e614768126d000b55e5df28f460.zip
binutils-09db3700263c5e614768126d000b55e5df28f460.tar.gz
binutils-09db3700263c5e614768126d000b55e5df28f460.tar.bz2
Introduce objc_selector_operation
This adds class objc_selector_operation, which implements OP_OBJC_SELECTOR. gdb/ChangeLog 2021-03-08 Tom Tromey <tom@tromey.com> * eval.c (eval_op_objc_selector): No longer static. * c-exp.h (class objc_selector_operation): New.
Diffstat (limited to 'gdb/c-exp.h')
-rw-r--r--gdb/c-exp.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/gdb/c-exp.h b/gdb/c-exp.h
index a7b11b5..dcb4557 100644
--- a/gdb/c-exp.h
+++ b/gdb/c-exp.h
@@ -23,6 +23,10 @@
#include "expop.h"
#include "objc-lang.h"
+extern struct value *eval_op_objc_selector (struct type *expect_type,
+ struct expression *exp,
+ enum noside noside,
+ const char *sel);
namespace expr
{
@@ -63,6 +67,27 @@ public:
{ return OP_OBJC_NSSTRING; }
};
+class objc_selector_operation
+ : public tuple_holding_operation<std::string>
+{
+public:
+
+ using tuple_holding_operation::tuple_holding_operation;
+
+ value *evaluate (struct type *expect_type,
+ struct expression *exp,
+ enum noside noside) override
+ {
+ if (noside == EVAL_SKIP)
+ return eval_skip_value (exp);
+ return eval_op_objc_selector (expect_type, exp, noside,
+ std::get<0> (m_storage).c_str ());
+ }
+
+ enum exp_opcode opcode () const override
+ { return OP_OBJC_SELECTOR; }
+};
+
}/* namespace expr */
#endif /* C_EXP_H */