diff options
author | Sergio Durigan Junior <sergiodj@redhat.com> | 2013-07-24 19:50:32 +0000 |
---|---|---|
committer | Sergio Durigan Junior <sergiodj@redhat.com> | 2013-07-24 19:50:32 +0000 |
commit | 25f9533e5145c7d1f41649536b710e12f3a1fcd9 (patch) | |
tree | 39c61fb54a54ee205ffe3d5f5fac735959a57535 /gdb/breakpoint.c | |
parent | df71cb5cbfa26ad79e5cf674056205f0505e229d (diff) | |
download | gdb-25f9533e5145c7d1f41649536b710e12f3a1fcd9.zip gdb-25f9533e5145c7d1f41649536b710e12f3a1fcd9.tar.gz gdb-25f9533e5145c7d1f41649536b710e12f3a1fcd9.tar.bz2 |
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/breakpoint.c')
-rw-r--r-- | gdb/breakpoint.c | 39 |
1 files changed, 35 insertions, 4 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 4d09b30..1e89407 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -3194,8 +3194,23 @@ create_longjmp_master_breakpoint (void) if (!bp_objfile_data->longjmp_searched) { - bp_objfile_data->longjmp_probes - = find_probes_in_objfile (objfile, "libc", "longjmp"); + VEC (probe_p) *ret; + + ret = find_probes_in_objfile (objfile, "libc", "longjmp"); + if (ret != NULL) + { + /* We are only interested in checking one element. */ + struct probe *p = VEC_index (probe_p, ret, 0); + + if (!can_evaluate_probe_arguments (p)) + { + /* We cannot use the probe interface here, because it does + not know how to evaluate arguments. */ + VEC_free (probe_p, ret); + ret = NULL; + } + } + bp_objfile_data->longjmp_probes = ret; bp_objfile_data->longjmp_searched = 1; } @@ -3336,8 +3351,24 @@ create_exception_master_breakpoint (void) /* We prefer the SystemTap probe point if it exists. */ if (!bp_objfile_data->exception_searched) { - bp_objfile_data->exception_probes - = find_probes_in_objfile (objfile, "libgcc", "unwind"); + VEC (probe_p) *ret; + + ret = find_probes_in_objfile (objfile, "libgcc", "unwind"); + + if (ret != NULL) + { + /* We are only interested in checking one element. */ + struct probe *p = VEC_index (probe_p, ret, 0); + + if (!can_evaluate_probe_arguments (p)) + { + /* We cannot use the probe interface here, because it does + not know how to evaluate arguments. */ + VEC_free (probe_p, ret); + ret = NULL; + } + } + bp_objfile_data->exception_probes = ret; bp_objfile_data->exception_searched = 1; } |