From 0569175e8e1820bb83569799c8d6dcbdf502c586 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tiago=20St=C3=BCrmer=20Daitx?= Date: Fri, 1 Nov 2013 11:41:37 -0500 Subject: [PATCH] breakpoint.c: fix libc probe scan when no get_longjmp_target exists. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit As discussed on the GDB ML[1], libc probes for longjmp were not being loaded if a custom _get_longjmp_target function was not implemented. This is trivially fixed by moving the 'if (!gdbarch_get_longjmp_target_p (gdbarch))' down, just bellow libc probe code and above the per-objfile cache lookup. While the condition could also be removed altogether with no side-effects, it is in fact an optimization to avoid searching for symbols if the arch doesn't provide support for get_longjmp_target(). This has been tested on PPC and PPC64. [1] https://sourceware.org/ml/gdb/2013-10/msg00191.html gdb/ 2013-11-01 Tiago Stürmer Daitx * breakpoint.c (create_longjmp_master_breakpoint): Allow libc probe scan even when the arch provides no get_longjmp_target. --- gdb/ChangeLog | 5 +++++ gdb/breakpoint.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 60a2bd91a68..2d6a7517999 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2013-11-01 Tiago Stürmer Daitx + + * breakpoint.c (create_longjmp_master_breakpoint): Allow libc + probe scan even when the arch provides no get_longjmp_target. + 2013-10-31 Pedro Alves * infrun.c (handle_syscall_event): Don't set or clear stop_signal. diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 1782c99ea15..ffe73fdc4ec 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -3226,8 +3226,6 @@ create_longjmp_master_breakpoint (void) struct breakpoint_objfile_data *bp_objfile_data; gdbarch = get_objfile_arch (objfile); - if (!gdbarch_get_longjmp_target_p (gdbarch)) - continue; bp_objfile_data = get_breakpoint_objfile_data (objfile); @@ -3277,6 +3275,9 @@ create_longjmp_master_breakpoint (void) continue; } + if (!gdbarch_get_longjmp_target_p (gdbarch)) + continue; + for (i = 0; i < NUM_LONGJMP_NAMES; i++) { struct breakpoint *b; -- 2.30.2