gdb's thread list.
(linux_nat_wait): Add main lwp to gdb's thread list.
* linux-thread-db.c (find_new_threads_callback): Also attach to
already listed threads which thread_db didn't know about yet.
+2008-03-25 Pedro Alves <pedro@codesourcery.com>
+
+ * linux-nat.c (linux_nat_attach): Add the pid we attached to, to
+ gdb's thread list.
+ (linux_nat_wait): Add main lwp to gdb's thread list.
+ * linux-thread-db.c (find_new_threads_callback): Also attach to
+ already listed threads which thread_db didn't know about yet.
+
2008-03-25 Pedro Alves <pedro@codesourcery.com>
* linux-nat.c (drain_queued_events): Fix comment typo.
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;
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);
td_thrinfo_t ti;
td_err_e err;
ptid_t ptid;
+ struct thread_info *tp;
err = td_thr_get_info_p (th_p, &ti);
if (err != TD_OK)
return 0;
}
- if (!in_thread_list (ptid))
+ tp = find_thread_pid (ptid);
+ if (tp == NULL || tp->private == NULL)
attach_thread (ptid, th_p, &ti);
return 0;