From 4cc1b3f79dcd9b5dc475c358a3388239e9d7b68b Mon Sep 17 00:00:00 2001 From: Jim Kingdon Date: Thu, 8 Dec 1994 22:54:33 +0000 Subject: * gdbserver/remote-utils.c (write_ok): Write "OK", not "Ok", to match stubs and protocol spec. * gdbserver/remote-utils.c (remote_open): Cast to struct sockaddr when passing to function which expects that. The following changes aren't quite enough to make things work with LynxOS (apprently kernel problems). * infrun.c (wait_for_inferior): When resuming new thread, pass pid not -1 for remote case. * thread.c (info_threads_command): Give error if !target_has_stack. * infrun.c (start_remote): Call init_thread_list. * thread.c (info_threads_command): Don't call kill for remote debugging target. * target.c (normal_pid_to_str): Print "thread" not "process" for remote. * remote.c, gdbserver/*: Add 'H', 'S', and 'C' requests, 'X' response, and `thread' part of 'T' response. * gdbserver/*: If program exits, send packet to GDB before exiting. Handle termination with a signal the same as exiting with an exitstatus. * remote.c: Don't try to kill program after getting an 'X' response. * infrun.c (wait_for_inferior): Add comment about kill versus mourn. --- gdb/thread.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'gdb/thread.c') diff --git a/gdb/thread.c b/gdb/thread.c index db0bbbf..0f6e67c 100644 --- a/gdb/thread.c +++ b/gdb/thread.c @@ -170,9 +170,17 @@ info_threads_command (arg, from_tty) struct thread_info *tp; int current_pid = inferior_pid; + /* Avoid coredumps which would happen if we tried to access a NULL + selected_frame. */ + if (!target_has_stack) error ("No stack."); + for (tp = thread_list; tp; tp = tp->next) { - if (target_has_execution + /* FIXME: need to figure out a way to do this for remote too, + or else the print_stack_frame below will fail with a bogus + thread ID. */ + if (!STREQ (current_target.to_shortname, "remote") + && target_has_execution && kill (tp->pid, 0) == -1) { tp->pid = -1; /* Mark it as dead */ -- cgit v1.1