From efd7ff149a42c865cac422e3bafdf386c91c5373 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 15 Dec 2020 18:35:13 -0700 Subject: Add expected type parameter to evaluate_expression While working on the expression rewrite, I found a few spots that called the internal functions of the expression evaluator, just to pass in an expected type. This patch adds a parameter to evaluate_expression so that these functions can avoid this dependency. Regression tested on x86-64 Fedora 28. gdb/ChangeLog 2020-12-15 Tom Tromey * stap-probe.c (stap_probe::evaluate_argument): Use evaluate_expression. * dtrace-probe.c (dtrace_probe::evaluate_argument): Use evaluate_expression. * value.h (evaluate_expression): Add expect_type parameter. * objc-lang.c (print_object_command): Call evaluate_expression. * eval.c (evaluate_expression): Add expect_type parameter. --- gdb/stap-probe.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'gdb/stap-probe.c') diff --git a/gdb/stap-probe.c b/gdb/stap-probe.c index 9a70471..ffcded3 100644 --- a/gdb/stap-probe.c +++ b/gdb/stap-probe.c @@ -1389,12 +1389,10 @@ struct value * stap_probe::evaluate_argument (unsigned n, struct frame_info *frame) { struct stap_probe_arg *arg; - int pos = 0; struct gdbarch *gdbarch = get_frame_arch (frame); arg = this->get_arg_by_number (n, gdbarch); - return evaluate_subexp_standard (arg->atype, arg->aexpr.get (), &pos, - EVAL_NORMAL); + return evaluate_expression (arg->aexpr.get (), arg->atype); } /* Compile the probe's argument N (indexed from 0) to agent expression. -- cgit v1.1