aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/low-lynx.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1995-07-13 21:40:22 +0000
committerJeff Law <law@redhat.com>1995-07-13 21:40:22 +0000
commit43fc25c87e2e768f17030ac44ea434dfc756add0 (patch)
tree88608d9e1787eaad3e2a146ac4b1f69f732d4073 /gdb/gdbserver/low-lynx.c
parent37ea61215c747745591c3042db2ac38c2c0ed0c8 (diff)
downloadgdb-43fc25c87e2e768f17030ac44ea434dfc756add0.zip
gdb-43fc25c87e2e768f17030ac44ea434dfc756add0.tar.gz
gdb-43fc25c87e2e768f17030ac44ea434dfc756add0.tar.bz2
* inftarg.c (child_thread_alive): New function to see if a
particular thread is still running. (child_ops): Add child_thread_alive entry. * remote.c (remote_thread_alive): New function to see if a particular thread is still alive. (remote_ops): Add remote_thread_alive. * target.c (dummy_target): Add dummy entry for thread_alive. (cleanup_target): de_fault thread_alive too. (update_current_target): INHERIT thread_alive too. (debug_to_thread_alive): New function. (setup_target_debug): Add debug_to_thread_alive. * target.h (struct target_ops): Add to_thread_alive. (target_thread_alive): Define. * thread.c (info_threads_command): Don't call kill; use target_thread_alive instead. * config/nm-lynx.h (CHILD_THREAD_ALIVE): Define. * gdbserver/low-lynx.c (mythread_alive): New function. (mywait): Don't restart any threads after a new thread notification, let the generic code handle it. * gdbserver/low-sparc.c (mythread_alive): Dummy version. * gdbserver/low-sun3.c (mythread_alive): Likewise. * gdbserver/server.c (main): Handle thread_alive requests. * gdbserver/server.h (mythread_alive): Declare. * corelow.c (core_ops): Add dummy entry for thread_alive. * exec.c (exec_ops): Likewise. * m3-nat.c (m3_ops): Likewise. * monitor.c (monitor_ops): Likewise. * procfs.c (procfs_ops): Likewise. * remote-arc.c (arc_ops): Likewise. * remote-array.c (array_ops): Likewise. * remote-e7000.c (e7000_ops): Likewise. * remote-es.c (es1800_ops, es1800_child_ops): Likewise. * remote-mips.c (mips_ops): Likewise. * remote-pa.c (remote_hppro_ops): Likewise. * remote-sim.c (gdbsim_ops): Likewise. * sparcl-tdep.c (sparclite_ops): Likewise. More lynx-6100 work
Diffstat (limited to 'gdb/gdbserver/low-lynx.c')
-rw-r--r--gdb/gdbserver/low-lynx.c31
1 files changed, 25 insertions, 6 deletions
diff --git a/gdb/gdbserver/low-lynx.c b/gdb/gdbserver/low-lynx.c
index 1de79bd..79103c3 100644
--- a/gdb/gdbserver/low-lynx.c
+++ b/gdb/gdbserver/low-lynx.c
@@ -99,6 +99,24 @@ kill_inferior ()
inferior_pid = 0;
}
+/* Return nonzero if the given thread is still alive. */
+int
+mythread_alive (pid)
+ int pid;
+{
+ /* Arggh. Apparently pthread_kill only works for threads within
+ the process that calls pthread_kill.
+
+ We want to avoid the lynx signal extensions as they simply don't
+ map well to the generic gdb interface we want to keep.
+
+ All we want to do is determine if a particular thread is alive;
+ it appears as if we can just make a harmless thread specific
+ ptrace call to do that. */
+ return (ptrace (PTRACE_THREADUSER,
+ BUILDPID (PIDGET (inferior_pid), pid), 0, 0) != -1);
+}
+
/* Wait for process, returns status */
unsigned char
@@ -132,12 +150,13 @@ mywait (status)
if (realsig == SIGNEWTHREAD)
{
- /* Simply ignore new thread notification, as we can't do anything
- useful with such threads. All ptrace calls at this point just
- fail for no apparent reason. The thread will eventually get a
- real signal when it becomes real. */
- myresume (0, 0);
- continue;
+ /* It's a new thread notification. Nothing to do here since
+ the machine independent code in wait_for_inferior will
+ add the thread to the thread list and restart the thread
+ when pid != inferior_pid and pid is not in the thread list.
+ We don't even want to muck with realsig -- the code in
+ wait_for_inferior expects SIGTRAP. */
+ ;
}
}
break;