* linux-low.c (get_stop_pc): Don't adjust the PC if stopped with
[deliverable/binutils-gdb.git] / gdb / gdbserver / linux-low.c
index 84f549cdb21243555f8b745e24e1fec62a00cb9e..59187ee68f8b959f9428214999e4c68d5c92b8df 100644 (file)
@@ -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;
This page took 0.024803 seconds and 4 git commands to generate.