Blame SOURCES/gdb-dlopen-stap-probe-1of9.patch

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