diff options
author | Tom Tromey <tom@tromey.com> | 2021-03-08 07:27:57 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2021-03-08 07:28:37 -0700 |
commit | 482ddd69c5f026aac98932be2fa8ac985b37d5be (patch) | |
tree | 3bcf09d59c5cc1108c3a5127f263c215adf8be1a /gdb/dtrace-probe.c | |
parent | 8227d9e2f4af14c7e36f1792747bd5d7edf71d6a (diff) | |
download | gdb-482ddd69c5f026aac98932be2fa8ac985b37d5be.zip gdb-482ddd69c5f026aac98932be2fa8ac985b37d5be.tar.gz gdb-482ddd69c5f026aac98932be2fa8ac985b37d5be.tar.bz2 |
Convert dtrace probes to use operations
This changes dtrace to use the new operation type.
gdb/ChangeLog
2021-03-08 Tom Tromey <tom@tromey.com>
* gdbarch.sh (dtrace_parse_probe_argument): Change return type.
* gdbarch.h: Rebuild.
* gdbarch.c: Rebuild.
* dtrace-probe.c (dtrace_probe::build_arg_exprs): Update.
* amd64-linux-tdep.c (amd64_dtrace_parse_probe_argument): Change
return type.
(amd64_dtrace_parse_probe_argument): Update.
Diffstat (limited to 'gdb/dtrace-probe.c')
-rw-r--r-- | gdb/dtrace-probe.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/gdb/dtrace-probe.c b/gdb/dtrace-probe.c index f4b6bec..3fa02dd 100644 --- a/gdb/dtrace-probe.c +++ b/gdb/dtrace-probe.c @@ -32,6 +32,7 @@ #include "language.h" #include "parser-defs.h" #include "inferior.h" +#include "expop.h" /* The type of the ELF sections where we will find the DOF programs with information about probes. */ @@ -629,20 +630,18 @@ dtrace_probe::build_arg_exprs (struct gdbarch *gdbarch) /* The argument value, which is ABI dependent and casted to `long int'. */ - gdbarch_dtrace_parse_probe_argument (gdbarch, &builder, argc); + expr::operation_up op = gdbarch_dtrace_parse_probe_argument (gdbarch, + argc); /* Casting to the expected type, but only if the type was recognized at probe load time. Otherwise the argument will be evaluated as the long integer passed to the probe. */ if (arg.type != NULL) - { - write_exp_elt_opcode (&builder, UNOP_CAST); - write_exp_elt_type (&builder, arg.type); - write_exp_elt_opcode (&builder, UNOP_CAST); - } + op = expr::make_operation<expr::unop_cast_operation> (std::move (op), + arg.type); + builder.set_operation (std::move (op)); arg.expr = builder.release (); - prefixify_expression (arg.expr.get ()); ++argc; } } |