summaryrefslogtreecommitdiff
path: root/gdb/stap-probe.c
diff options
context:
space:
mode:
authorsergiodj <sergiodj>2013-07-24 19:50:31 +0000
committersergiodj <sergiodj>2013-07-24 19:50:31 +0000
commit99f4358f8203da67f08fbcdd84f984709a50c68b (patch)
tree83a23824a94961e33f7abb3f15e40e72ddec904b /gdb/stap-probe.c
parent0387eeea5b1bd190f27e85448b9a8a93e2bd438a (diff)
downloadgdb-99f4358f8203da67f08fbcdd84f984709a50c68b.tar.gz
2013-07-24 Sergio Durigan Junior <sergiodj@redhat.com>
* breakpoint.c (create_longjmp_master_breakpoint): Check if probe interface can evaluate arguments. Fallback to the old mode if it cannot. (create_exception_master_breakpoint): Likewise. * elfread.c (elf_can_evaluate_probe_arguments): New function. (struct sym_probe_fns elf_probe_fns): Export function above to the probe interface. * probe.c (can_evaluate_probe_arguments): New function. * probe.h (struct probe_ops) <can_evaluate_probe_arguments>: New function pointer. (can_evaluate_probe_arguments): New function prototype. * solib-svr4.c (svr4_create_solib_event_breakpoints): Check if probe interface can evaluate arguments. Fallback to the old mode if it cannot. * stap-probe.c (stap_get_probe_argument_count): Check if probe interface can evaluate arguments. Warning the user if it cannot. (stap_can_evaluate_probe_arguments): New function. (struct probe_ops stap_probe_ops): Export function above to the probe interface. * symfile.h (struct sym_probe_fns) <can_evaluate_probe_arguments>: New function pointer.
Diffstat (limited to 'gdb/stap-probe.c')
-rw-r--r--gdb/stap-probe.c37
1 files changed, 36 insertions, 1 deletions
diff --git a/gdb/stap-probe.c b/gdb/stap-probe.c
index 1079e3ba497..cbbdf391130 100644
--- a/gdb/stap-probe.c
+++ b/gdb/stap-probe.c
@@ -1009,7 +1009,27 @@ stap_get_probe_argument_count (struct probe *probe_generic)
gdb_assert (probe_generic->pops == &stap_probe_ops);
if (!probe->args_parsed)
- stap_parse_probe_arguments (probe);
+ {
+ if (probe_generic->pops->can_evaluate_probe_arguments (probe_generic))
+ stap_parse_probe_arguments (probe);
+ else
+ {
+ static int have_warned_stap_incomplete = 0;
+
+ if (!have_warned_stap_incomplete)
+ {
+ warning (_(
+"The SystemTap SDT probe support is not fully implemented on this target;\n"
+"you will not be able to inspect the arguments of the probes.\n"
+"Please report a bug against GDB requesting a port to this target."));
+ have_warned_stap_incomplete = 1;
+ }
+
+ /* Marking the arguments as "already parsed". */
+ probe->args_u.vec = NULL;
+ probe->args_parsed = 1;
+ }
+ }
gdb_assert (probe->args_parsed);
return VEC_length (stap_probe_arg_s, probe->args_u.vec);
@@ -1060,6 +1080,20 @@ stap_get_arg (struct stap_probe *probe, unsigned n)
return VEC_index (stap_probe_arg_s, probe->args_u.vec, n);
}
+/* Implement the `can_evaluate_probe_arguments' method of probe_ops. */
+
+static int
+stap_can_evaluate_probe_arguments (struct probe *probe_generic)
+{
+ struct stap_probe *stap_probe = (struct stap_probe *) probe_generic;
+ struct gdbarch *gdbarch = stap_probe->p.objfile->gdbarch;
+
+ /* For SystemTap probes, we have to guarantee that the method
+ stap_is_single_operand is defined on gdbarch. If it is not, then it
+ means that argument evaluation is not implemented on this target. */
+ return gdbarch_stap_is_single_operand_p (gdbarch);
+}
+
/* Evaluate the probe's argument N (indexed from 0), returning a value
corresponding to it. Assertion is thrown if N does not exist. */
@@ -1520,6 +1554,7 @@ static const struct probe_ops stap_probe_ops =
stap_get_probes,
stap_relocate,
stap_get_probe_argument_count,
+ stap_can_evaluate_probe_arguments,
stap_evaluate_probe_argument,
stap_compile_to_ax,
stap_set_semaphore,