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.
This commit is contained in:
parent
c1299a2344
commit
d182f27979
5 changed files with 371 additions and 310 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue