From fe01123efb30a273645dc194ae2100197f93a00a Mon Sep 17 00:00:00 2001 From: Alan Hayward Date: Wed, 21 Aug 2019 15:24:02 +0100 Subject: Use gdbarch for probe::get_argument_count The probe function get_argument_count does not need a frame, only the current gdbarch. Switch the code to pass gdbarch instead. No functional changes. gdb/ChangeLog: * break-catch-throw.c (fetch_probe_arguments): Use gdbarch. * dtrace-probe.c (dtrace_probe::get_argument_count): Likewise. * probe.c (probe_safe_evaluate_at_pc) (compute_probe_arg) (compile_probe_arg): Likewise. * probe.h (get_argument_count): Likewise. * solib-svr4.c (solib_event_probe_action): Likewise. * stap-probe.c (stap_probe::get_argument_count): Likewise. --- gdb/probe.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'gdb/probe.c') diff --git a/gdb/probe.c b/gdb/probe.c index cdc6e02..8b108d6 100644 --- a/gdb/probe.c +++ b/gdb/probe.c @@ -695,7 +695,7 @@ probe_safe_evaluate_at_pc (struct frame_info *frame, unsigned n) if (!probe.prob) return NULL; - n_args = probe.prob->get_argument_count (frame); + n_args = probe.prob->get_argument_count (get_frame_arch (frame)); if (n >= n_args) return NULL; @@ -818,7 +818,7 @@ compute_probe_arg (struct gdbarch *arch, struct internalvar *ivar, if (pc_probe.prob == NULL) error (_("No probe at PC %s"), core_addr_to_string (pc)); - n_args = pc_probe.prob->get_argument_count (frame); + n_args = pc_probe.prob->get_argument_count (arch); if (sel == -1) return value_from_longest (builtin_type (arch)->builtin_int, n_args); @@ -840,7 +840,6 @@ compile_probe_arg (struct internalvar *ivar, struct agent_expr *expr, int sel = (int) (uintptr_t) data; struct bound_probe pc_probe; int n_args; - struct frame_info *frame = get_selected_frame (NULL); /* SEL == -1 means "_probe_argc". */ gdb_assert (sel >= -1); @@ -849,7 +848,7 @@ compile_probe_arg (struct internalvar *ivar, struct agent_expr *expr, if (pc_probe.prob == NULL) error (_("No probe at PC %s"), core_addr_to_string (pc)); - n_args = pc_probe.prob->get_argument_count (frame); + n_args = pc_probe.prob->get_argument_count (expr->gdbarch); if (sel == -1) { -- cgit v1.1