aboutsummaryrefslogtreecommitdiff
path: root/gdb/thread.c
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1994-12-08 22:54:33 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1994-12-08 22:54:33 +0000
commit4cc1b3f79dcd9b5dc475c358a3388239e9d7b68b (patch)
tree0783784fe967a54e89aed7aa93b8fc0010bce7ee /gdb/thread.c
parent4181c9853b48e3a4deb6c518e4b0a6a901eef7ac (diff)
downloadgdb-4cc1b3f79dcd9b5dc475c358a3388239e9d7b68b.zip
gdb-4cc1b3f79dcd9b5dc475c358a3388239e9d7b68b.tar.gz
gdb-4cc1b3f79dcd9b5dc475c358a3388239e9d7b68b.tar.bz2
* 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.
Diffstat (limited to 'gdb/thread.c')
-rw-r--r--gdb/thread.c10
1 files changed, 9 insertions, 1 deletions
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 */