aboutsummaryrefslogtreecommitdiff
path: root/gdb/thread-db.c
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2001-07-03 21:01:59 +0000
committerMichael Snyder <msnyder@vmware.com>2001-07-03 21:01:59 +0000
commit00783ba94cd6b3d2519a463b821b378369bd86cd (patch)
tree3a21a52cb697d91906bcc6b85c90006856bbc1e7 /gdb/thread-db.c
parent4970cb0f384c97323e3ebb54bf847636299e9e71 (diff)
downloadgdb-00783ba94cd6b3d2519a463b821b378369bd86cd.zip
gdb-00783ba94cd6b3d2519a463b821b378369bd86cd.tar.gz
gdb-00783ba94cd6b3d2519a463b821b378369bd86cd.tar.bz2
2001-06-29 Ken Whaley <ken@believe.com>
* thread-db.c (attach_thread): Check for TD_THR_ZOMBIE in addition to TD_THR_UNKNOWN when looking for defunct zombie threads. (thread_db_thread_alive): Ditto. (find_new_threads_callback): Ditto.
Diffstat (limited to 'gdb/thread-db.c')
-rw-r--r--gdb/thread-db.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gdb/thread-db.c b/gdb/thread-db.c
index d989c49..364dcc7 100644
--- a/gdb/thread-db.c
+++ b/gdb/thread-db.c
@@ -573,7 +573,8 @@ attach_thread (ptid_t ptid, const td_thrhandle_t *th_p,
tp->private = xmalloc (sizeof (struct private_thread_info));
tp->private->lwpid = ti_p->ti_lid;
- if (ti_p->ti_state == TD_THR_UNKNOWN)
+ if (ti_p->ti_state == TD_THR_UNKNOWN ||
+ ti_p->ti_state == TD_THR_ZOMBIE)
return;/* A zombie thread that's been joined -- do not attach. */
/* Under Linux, we have to attach to each and every thread. */
@@ -915,7 +916,8 @@ thread_db_thread_alive (ptid_t ptid)
if (err != TD_OK)
return 0;
- if (ti.ti_state == TD_THR_UNKNOWN)
+ if (ti.ti_state == TD_THR_UNKNOWN ||
+ ti.ti_state == TD_THR_ZOMBIE)
return 0; /* A zombie thread that's been joined. */
return 1;
@@ -938,7 +940,9 @@ find_new_threads_callback (const td_thrhandle_t *th_p, void *data)
if (err != TD_OK)
error ("Cannot get thread info: %s", thread_db_err_str (err));
- if (ti.ti_state == TD_THR_UNKNOWN)
+ if (ti.ti_state == TD_THR_UNKNOWN ||
+ ti.ti_state == TD_THR_ZOMBIE)
+
return 0; /* A zombie that's been reaped -- ignore. */
ptid = BUILD_THREAD (ti.ti_tid, GET_PID (inferior_ptid));