aboutsummaryrefslogtreecommitdiff
path: root/gdb/thread.c
diff options
context:
space:
mode:
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 */