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

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