aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2009-05-24 17:44:19 +0000
committerDoug Evans <dje@google.com>2009-05-24 17:44:19 +0000
commite27d73f6b0fa7a7bb175b7b52b9fce5ff535e239 (patch)
treed0a888b4173d3662498b1c68dcebcfd586f15c33 /gdb/gdbserver
parent47c0c975422ae5af7176a3e8b6550cb2faff06d1 (diff)
downloadgdb-e27d73f6b0fa7a7bb175b7b52b9fce5ff535e239.zip
gdb-e27d73f6b0fa7a7bb175b7b52b9fce5ff535e239.tar.gz
gdb-e27d73f6b0fa7a7bb175b7b52b9fce5ff535e239.tar.bz2
* linux-low.c (handle_extended_wait): Use linux_resume_one_lwp
to resume the newly created thread, don't call ptrace (PTRACE_CONT) directly.
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r--gdb/gdbserver/ChangeLog4
-rw-r--r--gdb/gdbserver/linux-low.c15
2 files changed, 13 insertions, 6 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index f5f272f..472fc00 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,5 +1,9 @@
2009-05-24 Doug Evans <dje@google.com>
+ * linux-low.c (handle_extended_wait): Use linux_resume_one_lwp
+ to resume the newly created thread, don't call ptrace (PTRACE_CONT)
+ directly.
+
* linux-low.c (get_stop_pc): Print pc if debug_threads.
(check_removed_breakpoint, linux_wait_for_lwp): Ditto.
(linux_resume_one_lwp): Ditto.
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index f721737..9af9e6e 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -295,29 +295,32 @@ handle_extended_wait (struct lwp_info *event_child, int wstat)
new_lwp = (struct lwp_info *) add_lwp (ptid);
add_thread (ptid, new_lwp);
+ /* Either we're going to immediately resume the new thread
+ or leave it stopped. linux_resume_one_lwp is a nop if it
+ thinks the thread is currently running, so set this first
+ before calling linux_resume_one_lwp. */
+ new_lwp->stopped = 1;
+
/* Normally we will get the pending SIGSTOP. But in some cases
we might get another signal delivered to the group first.
If we do get another signal, be sure not to lose it. */
if (WSTOPSIG (status) == SIGSTOP)
{
- if (stopping_threads)
- new_lwp->stopped = 1;
- else
- ptrace (PTRACE_CONT, new_pid, 0, 0);
+ if (! stopping_threads)
+ linux_resume_one_lwp (new_lwp, 0, 0, NULL);
}
else
{
new_lwp->stop_expected = 1;
if (stopping_threads)
{
- new_lwp->stopped = 1;
new_lwp->status_pending_p = 1;
new_lwp->status_pending = status;
}
else
/* Pass the signal on. This is what GDB does - except
shouldn't we really report it instead? */
- ptrace (PTRACE_CONT, new_pid, 0, WSTOPSIG (status));
+ linux_resume_one_lwp (new_lwp, 0, WSTOPSIG (status), NULL);
}
/* Always resume the current thread. If we are stopping