aboutsummaryrefslogtreecommitdiff
path: root/gdb/lynx-nat.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1995-07-20 21:25:12 +0000
committerJeff Law <law@redhat.com>1995-07-20 21:25:12 +0000
commit5c54124babc0fa0b89be7a04c245d1784a9dcbaa (patch)
treeed5a01ed5fecdc0af070544100c1288b4c132d0b /gdb/lynx-nat.c
parent76087c53880862bfbd1d759e9bb588ae43f02a61 (diff)
downloadgdb-5c54124babc0fa0b89be7a04c245d1784a9dcbaa.zip
gdb-5c54124babc0fa0b89be7a04c245d1784a9dcbaa.tar.gz
gdb-5c54124babc0fa0b89be7a04c245d1784a9dcbaa.tar.bz2
* lynx-nat.c (child_wait): A thread_id of zero from wait apparently
means the process is single threaded, so there's no need to add it to the thread list. Handle case where multi-threaded process reverts back to a single-threaded process.
Diffstat (limited to 'gdb/lynx-nat.c')
-rw-r--r--gdb/lynx-nat.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gdb/lynx-nat.c b/gdb/lynx-nat.c
index 1ab9cc7..883496e 100644
--- a/gdb/lynx-nat.c
+++ b/gdb/lynx-nat.c
@@ -631,7 +631,7 @@ child_wait (pid, ourstatus)
/* Initial thread value can only be acquired via wait, so we have to
resort to this hack. */
- if (TIDGET (inferior_pid) == 0)
+ if (TIDGET (inferior_pid) == 0 && thread != 0)
{
inferior_pid = BUILDPID (inferior_pid, thread);
add_thread (inferior_pid);
@@ -639,6 +639,11 @@ child_wait (pid, ourstatus)
pid = BUILDPID (pid, thread);
+ /* We've become a single threaded process again. */
+ if (thread == 0)
+ inferior_pid = pid;
+
+ /* Check for thread creation. */
if (WIFSTOPPED(status)
&& WSTOPSIG(status) == SIGTRAP
&& !in_thread_list (pid))