* infrun.c (handle_signal_stop): Replace test for
authorDoug Evans <xdje42@gmail.com>
Sun, 2 Mar 2014 21:51:35 +0000 (16:51 -0500)
committerDoug Evans <xdje42@gmail.com>
Sun, 2 Mar 2014 21:51:35 +0000 (16:51 -0500)
TARGET_WAITKIND_STOPPED with an assert.

gdb/ChangeLog
gdb/infrun.c

index eb2565e943a2952a4123daf08ac2e2075ed1647e..20a995326fd038fea48163dcbd25ed9c47b5eac4 100644 (file)
@@ -1,3 +1,8 @@
+2014-03-02  Doug Evans  <xdje42@gmail.com>
+
+       * infrun.c (handle_signal_stop): Replace test for
+       TARGET_WAITKIND_STOPPED with an assert.
+
 2014-03-02  Doug Evans  <xdje42@gmail.com>
 
        * guile/scm-objfile.c (ofscm_mark_objfile_smob): Fix typo in comment.
index 042d5fa76ac6c62ee1aaa406d304fc2f85ccbf65..c57c6b3851524de2a4913925575b06e98b55c9cd 100644 (file)
@@ -3781,22 +3781,20 @@ handle_signal_stop (struct execution_control_state *ecs)
   enum stop_kind stop_soon;
   int random_signal;
 
-  if (ecs->ws.kind == TARGET_WAITKIND_STOPPED)
-    {
-      /* Do we need to clean up the state of a thread that has
-        completed a displaced single-step?  (Doing so usually affects
-        the PC, so do it here, before we set stop_pc.)  */
-      displaced_step_fixup (ecs->ptid,
-                           ecs->event_thread->suspend.stop_signal);
-
-      /* If we either finished a single-step or hit a breakpoint, but
-        the user wanted this thread to be stopped, pretend we got a
-        SIG0 (generic unsignaled stop).  */
-
-      if (ecs->event_thread->stop_requested
-         && ecs->event_thread->suspend.stop_signal == GDB_SIGNAL_TRAP)
-       ecs->event_thread->suspend.stop_signal = GDB_SIGNAL_0;
-    }
+  gdb_assert (ecs->ws.kind == TARGET_WAITKIND_STOPPED);
+
+  /* Do we need to clean up the state of a thread that has
+     completed a displaced single-step?  (Doing so usually affects
+     the PC, so do it here, before we set stop_pc.)  */
+  displaced_step_fixup (ecs->ptid,
+                       ecs->event_thread->suspend.stop_signal);
+
+  /* If we either finished a single-step or hit a breakpoint, but
+     the user wanted this thread to be stopped, pretend we got a
+     SIG0 (generic unsignaled stop).  */
+  if (ecs->event_thread->stop_requested
+      && ecs->event_thread->suspend.stop_signal == GDB_SIGNAL_TRAP)
+    ecs->event_thread->suspend.stop_signal = GDB_SIGNAL_0;
 
   stop_pc = regcache_read_pc (get_thread_regcache (ecs->ptid));