From af99052775b274a23fd8004bf816f9b299b96b23 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Mon, 8 Sep 2008 21:25:05 +0000 Subject: * inf-ptrace.c: Include "gdbthread.h". (inf_ptrace_attach): Add the main thread here. * linux-nat.c (linux_nat_attach): Don't add the main thread here. Decorate the main thread id with the lwp id. --- gdb/inf-ptrace.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gdb/inf-ptrace.c') diff --git a/gdb/inf-ptrace.c b/gdb/inf-ptrace.c index ee2c8fa..6899be0 100644 --- a/gdb/inf-ptrace.c +++ b/gdb/inf-ptrace.c @@ -33,6 +33,7 @@ #include #include "inf-child.h" +#include "gdbthread.h" /* HACK: Save the ptrace ops returned by inf_ptrace_target. */ static struct target_ops *ptrace_ops_hack; @@ -218,6 +219,11 @@ inf_ptrace_attach (char *args, int from_tty) #endif inferior_ptid = pid_to_ptid (pid); + + /* Always add a main thread. If some target extends the ptrace + target, it should decorate the ptid later with more info. */ + add_thread_silent (inferior_ptid); + push_target (ptrace_ops_hack); } -- cgit v1.1