diff options
Diffstat (limited to 'gdb/gdbserver/linux-low.c')
-rw-r--r-- | gdb/gdbserver/linux-low.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index 5cbd3088ef1..efa0774ca30 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -4119,7 +4119,6 @@ single_step (struct lwp_info* lwp) } /* The signal can be delivered to the inferior if we are not trying to - reinsert a breakpoint for software single step and not trying to finish a fast tracepoint collect. Since signal can be delivered in the step-over, the program may go to signal handler and trap again after return from the signal handler. We can live with the spurious @@ -4128,8 +4127,7 @@ single_step (struct lwp_info* lwp) static int lwp_signal_can_be_delivered (struct lwp_info *lwp) { - return (!(lwp->bp_reinsert != 0 && can_software_single_step ()) - && !lwp->collecting_fast_tracepoint); + return !lwp->collecting_fast_tracepoint; } /* Resume execution of LWP. If STEP is nonzero, single-step it. If @@ -4578,6 +4576,20 @@ need_step_over_p (struct inferior_list_entry *entry, void *dummy) return 0; } + /* On software single step target, resume the inferior with signal + rather than stepping over. */ + if (can_software_single_step () + && lwp->pending_signals != NULL + && lwp_signal_can_be_delivered (lwp)) + { + if (debug_threads) + debug_printf ("Need step over [LWP %ld]? Ignoring, has pending" + " signals.\n", + lwpid_of (thread)); + + return 0; + } + saved_thread = current_thread; current_thread = thread; |