aboutsummaryrefslogtreecommitdiff
path: root/gdb/probe.c
diff options
context:
space:
mode:
authorGary Benson <gary@redhat.com>2013-06-04 12:50:21 +0000
committerGary Benson <gary@redhat.com>2013-06-04 12:50:21 +0000
commit9ee6a5acd5d83655e5af4a79c83f31dfce0a2a8e (patch)
treec4505fe5e7f2dcd00eda4fea3402d7e6b812f412 /gdb/probe.c
parent845d47080b7d7e068e4ec3d11fe6e27b403ac6e3 (diff)
downloadgdb-9ee6a5acd5d83655e5af4a79c83f31dfce0a2a8e.zip
gdb-9ee6a5acd5d83655e5af4a79c83f31dfce0a2a8e.tar.gz
gdb-9ee6a5acd5d83655e5af4a79c83f31dfce0a2a8e.tar.bz2
2013-06-04 Gary Benson <gbenson@redhat.com>
* probe.h (get_probe_argument_count): New declaration. (evaluate_probe_argument): Likewise. * probe.c (get_probe_argument_count): New function. (evaluate_probe_argument): Likewise. (probe_safe_evaluate_at_pc): Use the above new functions.
Diffstat (limited to 'gdb/probe.c')
-rw-r--r--gdb/probe.c45
1 files changed, 36 insertions, 9 deletions
diff --git a/gdb/probe.c b/gdb/probe.c
index 3086f4d..e650892 100644
--- a/gdb/probe.c
+++ b/gdb/probe.c
@@ -611,28 +611,55 @@ info_probes_command (char *arg, int from_tty)
/* See comments in probe.h. */
+unsigned
+get_probe_argument_count (struct probe *probe)
+{
+ const struct sym_probe_fns *probe_fns;
+
+ gdb_assert (probe->objfile != NULL);
+ gdb_assert (probe->objfile->sf != NULL);
+
+ probe_fns = probe->objfile->sf->sym_probe_fns;
+
+ gdb_assert (probe_fns != NULL);
+
+ return probe_fns->sym_get_probe_argument_count (probe);
+}
+
+/* See comments in probe.h. */
+
+struct value *
+evaluate_probe_argument (struct probe *probe, unsigned n)
+{
+ const struct sym_probe_fns *probe_fns;
+
+ gdb_assert (probe->objfile != NULL);
+ gdb_assert (probe->objfile->sf != NULL);
+
+ probe_fns = probe->objfile->sf->sym_probe_fns;
+
+ gdb_assert (probe_fns != NULL);
+
+ return probe_fns->sym_evaluate_probe_argument (probe, n);
+}
+
+/* See comments in probe.h. */
+
struct value *
probe_safe_evaluate_at_pc (struct frame_info *frame, unsigned n)
{
struct probe *probe;
- const struct sym_probe_fns *probe_fns;
unsigned n_args;
probe = find_probe_by_pc (get_frame_pc (frame));
if (!probe)
return NULL;
- gdb_assert (probe->objfile != NULL);
- gdb_assert (probe->objfile->sf != NULL);
- gdb_assert (probe->objfile->sf->sym_probe_fns != NULL);
-
- probe_fns = probe->objfile->sf->sym_probe_fns;
- n_args = probe_fns->sym_get_probe_argument_count (probe);
-
+ n_args = get_probe_argument_count (probe);
if (n >= n_args)
return NULL;
- return probe_fns->sym_evaluate_probe_argument (probe, n);
+ return evaluate_probe_argument (probe, n);
}
/* See comment in probe.h. */