aboutsummaryrefslogtreecommitdiff
path: root/gdb/objc-lang.c
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:38 -0700
commitd182f2797922a305fbd1ef6a483cc39a56b43e02 (patch)
tree7fb8bb5c51031d16dd169180accded548f17041b /gdb/objc-lang.c
parentc1299a23448227e9bb57df883aba0118618db9f4 (diff)
downloadfsf-binutils-gdb-d182f2797922a305fbd1ef6a483cc39a56b43e02.zip
fsf-binutils-gdb-d182f2797922a305fbd1ef6a483cc39a56b43e02.tar.gz
fsf-binutils-gdb-d182f2797922a305fbd1ef6a483cc39a56b43e02.tar.bz2
Convert c-exp.y to use operations
This converts the C parser to generate operations rather than exp_elements. One test needed a tweak in order to handle the different debugging output. gdb/ChangeLog 2021-03-08 Tom Tromey <tom@tromey.com> * objc-lang.c (end_msglist): Create operations. * c-exp.y: Change parser to create operations. (write_destructor_name): Remove. (c_parse): Update. gdb/testsuite/ChangeLog 2021-03-08 Tom Tromey <tom@tromey.com> * gdb.base/debug-expr.exp: Update expected dump output.
Diffstat (limited to 'gdb/objc-lang.c')
-rw-r--r--gdb/objc-lang.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c
index 6789628..788fe0f 100644
--- a/gdb/objc-lang.c
+++ b/gdb/objc-lang.c
@@ -43,6 +43,7 @@
#include "infcall.h"
#include "valprint.h"
#include "cli/cli-utils.h"
+#include "c-exp.h"
#include <ctype.h>
#include <algorithm>
@@ -507,15 +508,20 @@ end_msglist (struct parser_state *ps)
char *p = msglist_sel;
CORE_ADDR selid;
+ std::vector<expr::operation_up> args = ps->pop_vector (val);
+ expr::operation_up target = ps->pop ();
+
selname_chain = sel->next;
msglist_len = sel->msglist_len;
msglist_sel = sel->msglist_sel;
selid = lookup_child_selector (ps->gdbarch (), p);
if (!selid)
error (_("Can't find selector \"%s\""), p);
- write_exp_elt_longcst (ps, selid);
+
+ ps->push_new<expr::objc_msgcall_operation> (selid, std::move (target),
+ std::move (args));
+
xfree(p);
- write_exp_elt_longcst (ps, val); /* Number of args */
xfree(sel);
return val;