gdb/
[deliverable/binutils-gdb.git] / gdb / remote.c
index 38ecd086345c165b6743c7a7d06eaffddb5c0ed7..01e3f306c93d03ff232cc02a7160a27e78104af9 100644 (file)
@@ -4644,6 +4644,28 @@ append_resumption (char *p, char *endp,
   return p;
 }
 
+/* Append a vCont continue-with-signal action for threads that have a
+   non-zero stop signal.  */
+
+static char *
+append_pending_thread_resumptions (char *p, char *endp, ptid_t ptid)
+{
+  struct thread_info *thread;
+
+  ALL_THREADS (thread)
+    if (ptid_match (thread->ptid, ptid)
+       && !ptid_equal (inferior_ptid, thread->ptid)
+       && thread->suspend.stop_signal != GDB_SIGNAL_0
+       && signal_pass_state (thread->suspend.stop_signal))
+      {
+       p = append_resumption (p, endp, thread->ptid,
+                              0, thread->suspend.stop_signal);
+       thread->suspend.stop_signal = GDB_SIGNAL_0;
+      }
+
+  return p;
+}
+
 /* Resume the remote inferior by using a "vCont" packet.  The thread
    to be resumed is PTID; STEP and SIGGNAL indicate whether the
    resumed thread should be single-stepped and/or signalled.  If PTID
@@ -4696,6 +4718,10 @@ remote_vcont_resume (ptid_t ptid, int step, enum gdb_signal siggnal)
          p = append_resumption (p, endp, inferior_ptid, step, siggnal);
        }
 
+      /* Also pass down any pending signaled resumption for other
+        threads not the current.  */
+      p = append_pending_thread_resumptions (p, endp, ptid);
+
       /* And continue others without a signal.  */
       append_resumption (p, endp, ptid, /*step=*/ 0, GDB_SIGNAL_0);
     }
This page took 0.029837 seconds and 4 git commands to generate.