diff options
Diffstat (limited to 'gdb/remote.c')
-rw-r--r-- | gdb/remote.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gdb/remote.c b/gdb/remote.c index 38ecd08..01e3f30 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -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); } |