diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index 45061ac..2f30bc1 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -3662,17 +3662,31 @@ linux_wait_1 (ptid_t ptid, (*the_low_target.set_pc) (regcache, event_child->stop_pc); } - /* We may have finished stepping over a breakpoint. If so, - we've stopped and suspended all LWPs momentarily except the - stepping one. This is where we resume them all again. We're - going to keep waiting, so use proceed, which handles stepping - over the next breakpoint. */ - if (debug_threads) - debug_printf ("proceeding all threads.\n"); - if (step_over_finished) - unsuspend_all_lwps (event_child); + { + /* If we have finished stepping over a breakpoint, we've + stopped and suspended all LWPs momentarily except the + stepping one. This is where we resume them all again. + We're going to keep waiting, so use proceed, which + handles stepping over the next breakpoint. */ + unsuspend_all_lwps (event_child); + } + else + { + /* Remove the singlestep breakpoints if any. Note that + there isn't singlestep breakpoint if we finished stepping + over. */ + if (can_software_single_step () + && has_reinsert_breakpoints (current_thread)) + { + stop_all_lwps (0, event_child); + delete_reinsert_breakpoints (current_thread); + unstop_all_lwps (0, event_child); + } + } + if (debug_threads) + debug_printf ("proceeding all threads.\n"); proceed_all_lwps (); return ignore_event (ourstatus); }