diff options
author | Yao Qi <yao.qi@linaro.org> | 2016-10-27 16:05:06 +0100 |
---|---|---|
committer | Yao Qi <yao.qi@linaro.org> | 2016-10-27 16:05:06 +0100 |
commit | e3652c8460a6247f50e24deaca1c1c1c0e2a2573 (patch) | |
tree | ed92c682078b3fa47cf8f5a58321753cc32f055f /gdb | |
parent | bb65a718b601ecfebd1ebe5be71728d5c359c31f (diff) | |
download | gdb-e3652c8460a6247f50e24deaca1c1c1c0e2a2573.zip gdb-e3652c8460a6247f50e24deaca1c1c1c0e2a2573.tar.gz gdb-e3652c8460a6247f50e24deaca1c1c1c0e2a2573.tar.bz2 |
Remove single-step breakpoint for GDBserver internal event
This patch removes single-step breakpoints if the event is only
GDBserver internal, IOW, isn't reported back to GDB.
gdb/gdbserver:
2016-10-27 Yao Qi <yao.qi@linaro.org>
* linux-low.c (linux_wait_1): If single-step breakpoints are
inserted, remove them.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/gdbserver/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/gdbserver/linux-low.c | 32 |
2 files changed, 28 insertions, 9 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 1a9c4e5..d43a96a 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,8 @@ +2016-10-27 Yao Qi <yao.qi@linaro.org> + + * linux-low.c (linux_wait_1): If single-step breakpoints are + inserted, remove them. + 2016-10-26 Pedro Alves <palves@redhat.com> * linux-low.c (handle_extended_wait): Link parent/child fork diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index f43ce7e..a463774 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -3684,17 +3684,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 single-step breakpoints if any. Note that + there isn't single-step breakpoint if we finished stepping + over. */ + if (can_software_single_step () + && has_single_step_breakpoints (current_thread)) + { + stop_all_lwps (0, event_child); + delete_single_step_breakpoints (current_thread); + unstop_all_lwps (0, event_child); + } + } + if (debug_threads) + debug_printf ("proceeding all threads.\n"); proceed_all_lwps (); if (debug_threads) |