gdb/gdb-dlopen-stap-probe-3of7.patch
Stephan Kulow 16b5661a6f Accepting request 147743 from devel:gcc
- Merge from gdb-7.5.1-30.fc18.src.rpm.
  7.5.1 gives:
    * An "Attempt to dereference a generic pointer" errors (-var-create).
    * Backtrace problems on x32 (PR backtrace/14646).
    * next/step/finish problems on x32 (PR gdb/14647).
    * A "malformed linespec error: unexpected keyword, [...]" error
      (PR breakpoints/14643).
    * GDB crash while stepping through powerpc (32bits) code.
    * A failed assertion in linux_ptrace_test_ret_to_nx.
    * A "!frame_id_inlined_p (frame_id)" failed assertion.
    * A "No more reverse-execution history." error during reverse
      "next" execution (PR 14548).
    * Incomplete command descriptions in "apropos" output.
    * PR gdb/14494 (a GDB crash difficult to characterize).
  7.5 gives:
    * Go language support.
    * New targets (x32 ABI, microMIPS, Renesas RL78, HP OpenVMS ia64).
    * More Python scripting improvements.
    * SDT (Static Defined Tracing) probes support with SystemTap probes.
    * GDBserver improvements (stdio connections, target-side evaluation
      of breakpoint conditions, remote protocol improvements).
    * Other miscellaneous improvements (ability to stop when a shared
      library is loaded/unloaded, dynamic printf, etc).
    * Reverse debugging on ARM.

- Do not provide a custom (safe) auto-load dir.

OBS-URL: https://build.opensuse.org/request/show/147743
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/gdb?expand=0&rev=90
2013-01-11 14:55:20 +00:00

99 lines
2.8 KiB
Diff

2012-07-19 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.
diff --git a/gdb/probe.h b/gdb/probe.h
index 8d44ca2..1d29b87 100644
--- a/gdb/probe.h
+++ b/gdb/probe.h
@@ -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,
diff --git a/gdb/probe.c b/gdb/probe.c
index 77f3b13..a61f4ea 100644
--- a/gdb/probe.c
+++ b/gdb/probe.c
@@ -632,28 +632,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. */