aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2010-04-01 15:31:26 +0000
committerPedro Alves <palves@redhat.com>2010-04-01 15:31:26 +0000
commitbdabb07895854f0a2109bbbe9755b8ea6d6a9611 (patch)
tree436015662e12a0d3b56548ad928abdd0765322fd /gdb/gdbserver
parentd3bbe7a0c8af16f3fab8b1bbe2f9d96e66818c27 (diff)
downloadgdb-bdabb07895854f0a2109bbbe9755b8ea6d6a9611.zip
gdb-bdabb07895854f0a2109bbbe9755b8ea6d6a9611.tar.gz
gdb-bdabb07895854f0a2109bbbe9755b8ea6d6a9611.tar.bz2
* linux-low.c (get_stop_pc): Don't adjust the PC if stopped with
an extended waitstatus, or by a watchpoint. (cancel_breakpoints_callback): Don't cancel a breakpoint if the thread was stepping or has been stopped by a watchpoint.
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r--gdb/gdbserver/ChangeLog7
-rw-r--r--gdb/gdbserver/linux-low.c16
2 files changed, 13 insertions, 10 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 21ea7c6..59289d7 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,5 +1,12 @@
2010-04-01 Pedro Alves <pedro@codesourcery.com>
+ * linux-low.c (get_stop_pc): Don't adjust the PC if stopped with
+ an extended waitstatus, or by a watchpoint.
+ (cancel_breakpoints_callback): Don't cancel a breakpoint if the
+ thread was stepping or has been stopped by a watchpoint.
+
+2010-04-01 Pedro Alves <pedro@codesourcery.com>
+
* mem-break.c (struct raw_breakpoint): New field shlib_disabled.
(set_gdb_breakpoint_at): If GDB is inserting a breakpoint on top
of another, then delete the previous, and validate all
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index 84f549c..59187ee 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -511,7 +511,10 @@ get_stop_pc (struct lwp_info *lwp)
stop_pc = get_pc (lwp);
- if (WSTOPSIG (lwp->last_status) == SIGTRAP && !lwp->stepping)
+ if (WSTOPSIG (lwp->last_status) == SIGTRAP
+ && !lwp->stepping
+ && !lwp->stopped_by_watchpoint
+ && lwp->last_status >> 16 == 0)
stop_pc -= the_low_target.decr_pc_after_break;
if (debug_threads)
@@ -1128,15 +1131,6 @@ cancel_breakpoint (struct lwp_info *lwp)
if (!supports_breakpoints ())
return 0;
- if (lwp->stepping)
- {
- if (debug_threads)
- fprintf (stderr,
- "CB: [%s] is stepping\n",
- target_pid_to_str (lwp->head.id));
- return 0;
- }
-
regcache = get_thread_regcache (get_lwp_thread (lwp), 1);
/* breakpoint_at reads from current inferior. */
@@ -1499,6 +1493,8 @@ cancel_breakpoints_callback (struct inferior_list_entry *entry, void *data)
&& lp->status_pending_p
&& WIFSTOPPED (lp->status_pending)
&& WSTOPSIG (lp->status_pending) == SIGTRAP
+ && !lp->stepping
+ && !lp->stopped_by_watchpoint
&& cancel_breakpoint (lp))
/* Throw away the SIGTRAP. */
lp->status_pending_p = 0;