diff options
author | Pedro Alves <palves@redhat.com> | 2008-03-25 12:26:21 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2008-03-25 12:26:21 +0000 |
commit | 403fe1979f7a9e128d3904731e709fadbf60ea81 (patch) | |
tree | 527a2add5ace4f83bc53ef19773a830bf1983af1 | |
parent | 710151dda51c86ee63e65409f87ad3b0ccc54936 (diff) | |
download | gdb-403fe1979f7a9e128d3904731e709fadbf60ea81.zip gdb-403fe1979f7a9e128d3904731e709fadbf60ea81.tar.gz gdb-403fe1979f7a9e128d3904731e709fadbf60ea81.tar.bz2 |
* 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.
-rw-r--r-- | gdb/ChangeLog | 8 | ||||
-rw-r--r-- | gdb/linux-nat.c | 6 | ||||
-rw-r--r-- | gdb/linux-thread-db.c | 4 |
3 files changed, 17 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 04792df..fc80108 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,13 @@ 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. (linux_nat_attach): In async mode, don't rely on storing a pending status. Instead place the wait status on the pipe. diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index e2ef962e..9511815 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -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); diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c index 534c9b9..8ac9818 100644 --- a/gdb/linux-thread-db.c +++ b/gdb/linux-thread-db.c @@ -918,6 +918,7 @@ find_new_threads_callback (const td_thrhandle_t *th_p, void *data) 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) @@ -945,7 +946,8 @@ find_new_threads_callback (const td_thrhandle_t *th_p, void *data) 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; |