aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2012-06-28 16:34:04 +0000
committerPedro Alves <palves@redhat.com>2012-06-28 16:34:04 +0000
commite5ef252af07bfbf40e78b0ebcc5eef2e3b0af7a3 (patch)
tree802ef5f4182c89facf11b44253f0ae0c96a8ca53 /gdb/remote.c
parentdc60a23811c4d144c0a1242d30c3f64e1d13e941 (diff)
downloadbinutils-e5ef252af07bfbf40e78b0ebcc5eef2e3b0af7a3.zip
binutils-e5ef252af07bfbf40e78b0ebcc5eef2e3b0af7a3.tar.gz
binutils-e5ef252af07bfbf40e78b0ebcc5eef2e3b0af7a3.tar.bz2
gdb/
2012-06-28 Jan Kratochvil <jan.kratochvil@redhat.com> Pedro Alves <palves@redhat.com> * gdbthread.h (ALL_THREADS): New macro. (thread_list): Declare. * infrun.c (handle_inferior_event) <spurious signal>: Don't keep going, but instead fall through to the stepping handling. * linux-nat.c (resume_lwp): New parameter 'signo'. Resume with the passed in signal. Adjust debug output. (resume_callback): Rename to ... (linux_nat_resume_callback): ... this. Pass the thread's last stop signal, if in "pass" state. (linux_nat_resume): Adjust to rename. (stop_wait_callback): New assertion. Don't respawn signals; instead let the LWP remain with SIGNALLED set. (linux_nat_wait_1): Remove flushing of pending SIGSTOPs. * remote.c (append_pending_thread_resumptions): New. (remote_vcont_resume): Call it. * target.h (target_resume): Extend comment. gdb/testsuite/ 2012-06-28 Jan Kratochvil <jan.kratochvil@redhat.com> Pedro Alves <palves@redhat.com> * gdb.threads/siginfo-threads.exp: New file. * gdb.threads/siginfo-threads.c: New file. * gdb.threads/sigstep-threads.exp: New file. * gdb.threads/sigstep-threads.c: New file.
Diffstat (limited to 'gdb/remote.c')
-rw-r--r--gdb/remote.c26
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);
}