* linux-nat.c (linux_nat_attach): Add the pid we attached to, to
[deliverable/binutils-gdb.git] / gdb / linux-nat.c
index e2ef962e125e4316a044730c06e9640268dcde5c..9511815ecd6f478ce87714dda4465d54abe3b06b 100644 (file)
@@ -1173,6 +1173,10 @@ linux_nat_attach (char *args, int from_tty)
   lp = add_lwp (inferior_ptid);
   lp->cloned = cloned;
 
+  /* If this process is not using thread_db, then we still don't
+     detect any other threads, but add at least this one.  */
+  add_thread_silent (lp->ptid);
+
   lp->stopped = 1;
   lp->resumed = 1;
 
@@ -2387,6 +2391,8 @@ linux_nat_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
                                 GET_PID (inferior_ptid));
       lp = add_lwp (inferior_ptid);
       lp->resumed = 1;
+      /* Add the main thread to GDB's thread list.  */
+      add_thread_silent (lp->ptid);
     }
 
   sigemptyset (&flush_mask);
This page took 0.02454 seconds and 4 git commands to generate.