2013-06-04 Gary Benson <gbenson@redhat.com>
authorGary Benson <gary@redhat.com>
Tue, 4 Jun 2013 12:50:21 +0000 (12:50 +0000)
committerGary Benson <gary@redhat.com>
Tue, 4 Jun 2013 12:50:21 +0000 (12:50 +0000)
* 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.

gdb/ChangeLog
gdb/probe.c
gdb/probe.h

index 3b5532df38d143e3a15289705db555e0ec7ea1e5..d00c88baf08222cc605a8736662486ec9a1b407f 100644 (file)
@@ -1,3 +1,11 @@
+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.
+
 2013-06-04  Alan Modra  <amodra@gmail.com>
 
        * ppc-tdep.h (ppc_insns_match_pattern): Update prototype.
index 3086f4df35df52adad86d967e5e30091c816a4e0..e6508927ac276141963795198e584321b8705d17 100644 (file)
@@ -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.  */
index be1faa432ee0bbd44e9e520027e3fe515024e3bb..de07f506523aa258a3a62fc380c2f2b97c2a9721 100644 (file)
@@ -214,6 +214,16 @@ extern void info_probes_for_ops (char *arg, int from_tty,
 
 extern struct cmd_list_element **info_probes_cmdlist_get (void);
 
+/* Return the argument count of the specified probe.  */
+
+extern unsigned get_probe_argument_count (struct probe *probe);
+
+/* Evaluate argument N of the specified probe.  N must be between 0
+   inclusive and get_probe_argument_count exclusive.  */
+
+extern struct value *evaluate_probe_argument (struct probe *probe,
+                                             unsigned n);
+
 /* A convenience function that finds a probe at the PC in FRAME and
    evaluates argument N, with 0 <= N < number_of_args.  If there is no
    probe at that location, or if the probe does not have enough arguments,
This page took 0.032169 seconds and 4 git commands to generate.