summaryrefslogtreecommitdiff
path: root/gdb/inf-ptrace.c
diff options
context:
space:
mode:
authorPedro Alves <pedro@codesourcery.com>2008-09-08 21:25:04 +0000
committerPedro Alves <pedro@codesourcery.com>2008-09-08 21:25:04 +0000
commit6b8c2192cc44981597e0b395f36a27e42dc9b498 (patch)
tree400d73c810d131a8ad687c95f3049df93c0ac0a4 /gdb/inf-ptrace.c
parent957e114ba3c9e9586e6dcfbf76a1a93605a4c368 (diff)
downloadgdb-6b8c2192cc44981597e0b395f36a27e42dc9b498.tar.gz
* 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.
Diffstat (limited to 'gdb/inf-ptrace.c')
-rw-r--r--gdb/inf-ptrace.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/inf-ptrace.c b/gdb/inf-ptrace.c
index ee2c8fa397d..6899be0bc85 100644
--- a/gdb/inf-ptrace.c
+++ b/gdb/inf-ptrace.c
@@ -33,6 +33,7 @@
#include <signal.h>
#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);
}