2c2fa1
http://sourceware.org/ml/gdb-cvs/2013-06/msg00012.html
2c2fa1
2c2fa1
### src/gdb/ChangeLog	2013/06/04 02:44:34	1.15680
2c2fa1
### src/gdb/ChangeLog	2013/06/04 12:50:20	1.15681
2c2fa1
## -1,3 +1,11 @@
2c2fa1
+2013-06-04  Gary Benson  <gbenson@redhat.com>
2c2fa1
+
2c2fa1
+	* probe.h (get_probe_argument_count): New declaration.
2c2fa1
+	(evaluate_probe_argument): Likewise.
2c2fa1
+	* probe.c (get_probe_argument_count): New function.
2c2fa1
+	(evaluate_probe_argument): Likewise.
2c2fa1
+	(probe_safe_evaluate_at_pc): Use the above new functions.
2c2fa1
+
2c2fa1
 2013-06-04  Alan Modra  <amodra@gmail.com>
2c2fa1
 
2c2fa1
 	* ppc-tdep.h (ppc_insns_match_pattern): Update prototype.
2c2fa1
--- src/gdb/probe.c	2013/05/30 17:39:34	1.8
2c2fa1
+++ src/gdb/probe.c	2013/06/04 12:50:20	1.9
2c2fa1
@@ -611,28 +611,55 @@
2c2fa1
 
2c2fa1
 /* See comments in probe.h.  */
2c2fa1
 
2c2fa1
+unsigned
2c2fa1
+get_probe_argument_count (struct probe *probe)
2c2fa1
+{
2c2fa1
+  const struct sym_probe_fns *probe_fns;
2c2fa1
+
2c2fa1
+  gdb_assert (probe->objfile != NULL);
2c2fa1
+  gdb_assert (probe->objfile->sf != NULL);
2c2fa1
+
2c2fa1
+  probe_fns = probe->objfile->sf->sym_probe_fns;
2c2fa1
+
2c2fa1
+  gdb_assert (probe_fns != NULL);
2c2fa1
+
2c2fa1
+  return probe_fns->sym_get_probe_argument_count (probe);
2c2fa1
+}
2c2fa1
+
2c2fa1
+/* See comments in probe.h.  */
2c2fa1
+
2c2fa1
+struct value *
2c2fa1
+evaluate_probe_argument (struct probe *probe, unsigned n)
2c2fa1
+{
2c2fa1
+  const struct sym_probe_fns *probe_fns;
2c2fa1
+
2c2fa1
+  gdb_assert (probe->objfile != NULL);
2c2fa1
+  gdb_assert (probe->objfile->sf != NULL);
2c2fa1
+
2c2fa1
+  probe_fns = probe->objfile->sf->sym_probe_fns;
2c2fa1
+
2c2fa1
+  gdb_assert (probe_fns != NULL);
2c2fa1
+
2c2fa1
+  return probe_fns->sym_evaluate_probe_argument (probe, n);
2c2fa1
+}
2c2fa1
+
2c2fa1
+/* See comments in probe.h.  */
2c2fa1
+
2c2fa1
 struct value *
2c2fa1
 probe_safe_evaluate_at_pc (struct frame_info *frame, unsigned n)
2c2fa1
 {
2c2fa1
   struct probe *probe;
2c2fa1
-  const struct sym_probe_fns *probe_fns;
2c2fa1
   unsigned n_args;
2c2fa1
 
2c2fa1
   probe = find_probe_by_pc (get_frame_pc (frame));
2c2fa1
   if (!probe)
2c2fa1
     return NULL;
2c2fa1
 
2c2fa1
-  gdb_assert (probe->objfile != NULL);
2c2fa1
-  gdb_assert (probe->objfile->sf != NULL);
2c2fa1
-  gdb_assert (probe->objfile->sf->sym_probe_fns != NULL);
2c2fa1
-
2c2fa1
-  probe_fns = probe->objfile->sf->sym_probe_fns;
2c2fa1
-  n_args = probe_fns->sym_get_probe_argument_count (probe);
2c2fa1
-
2c2fa1
+  n_args = get_probe_argument_count (probe);
2c2fa1
   if (n >= n_args)
2c2fa1
     return NULL;
2c2fa1
 
2c2fa1
-  return probe_fns->sym_evaluate_probe_argument (probe, n);
2c2fa1
+  return evaluate_probe_argument (probe, n);
2c2fa1
 }
2c2fa1
 
2c2fa1
 /* See comment in probe.h.  */
2c2fa1
--- src/gdb/probe.h	2013/01/01 06:32:49	1.4
2c2fa1
+++ src/gdb/probe.h	2013/06/04 12:50:21	1.5
2c2fa1
@@ -214,6 +214,16 @@
2c2fa1
 
2c2fa1
 extern struct cmd_list_element **info_probes_cmdlist_get (void);
2c2fa1
 
2c2fa1
+/* Return the argument count of the specified probe.  */
2c2fa1
+
2c2fa1
+extern unsigned get_probe_argument_count (struct probe *probe);
2c2fa1
+
2c2fa1
+/* Evaluate argument N of the specified probe.  N must be between 0
2c2fa1
+   inclusive and get_probe_argument_count exclusive.  */
2c2fa1
+
2c2fa1
+extern struct value *evaluate_probe_argument (struct probe *probe,
2c2fa1
+					      unsigned n);
2c2fa1
+
2c2fa1
 /* A convenience function that finds a probe at the PC in FRAME and
2c2fa1
    evaluates argument N, with 0 <= N < number_of_args.  If there is no
2c2fa1
    probe at that location, or if the probe does not have enough arguments,