aboutsummaryrefslogtreecommitdiff
path: root/linuxthreads_db
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-10-15 00:38:31 +0000
committerUlrich Drepper <drepper@redhat.com>1999-10-15 00:38:31 +0000
commitf6367df2fd032db89e68e28333d995fb18ffa653 (patch)
tree3b4bca3c94d629071e220c0f1a1b194c7dc8c3b6 /linuxthreads_db
parent3e1e749e27765b2513b32d9cb1cd058830e6b2c8 (diff)
downloadglibc-f6367df2fd032db89e68e28333d995fb18ffa653.tar
glibc-f6367df2fd032db89e68e28333d995fb18ffa653.tar.gz
glibc-f6367df2fd032db89e68e28333d995fb18ffa653.tar.bz2
glibc-f6367df2fd032db89e68e28333d995fb18ffa653.zip
Update.
1999-10-14 Ulrich Drepper <drepper@cygnus.com> * manager.c (pthread_handle_create): Remove p_startfct initialization. * internals.h (_pthread_descr_struct): We don't need p_startfct field.
Diffstat (limited to 'linuxthreads_db')
-rw-r--r--linuxthreads_db/ChangeLog9
-rw-r--r--linuxthreads_db/td_ta_thr_iter.c12
-rw-r--r--linuxthreads_db/td_thr_get_info.c12
-rw-r--r--linuxthreads_db/td_thr_validate.c4
4 files changed, 24 insertions, 13 deletions
diff --git a/linuxthreads_db/ChangeLog b/linuxthreads_db/ChangeLog
index a5486c93d2..c7836d3abd 100644
--- a/linuxthreads_db/ChangeLog
+++ b/linuxthreads_db/ChangeLog
@@ -1,3 +1,12 @@
+1999-10-14 Ulrich Drepper <drepper@cygnus.com>
+
+ * td_thr_get_info.c: Always initialize start function.
+
+ * td_ta_thr_iter.c: Don't return threads which exited (but are not
+ joined).
+
+ * td_thr_validate.c: Don't skip manager thread.
+
1999-10-13 Ulrich Drepper <drepper@cygnus.com>
* td_ta_thr_iter.c: Use size of descriptor from *TA.
diff --git a/linuxthreads_db/td_ta_thr_iter.c b/linuxthreads_db/td_ta_thr_iter.c
index 678dd7f01b..f9b5673ebf 100644
--- a/linuxthreads_db/td_ta_thr_iter.c
+++ b/linuxthreads_db/td_ta_thr_iter.c
@@ -66,9 +66,15 @@ td_ta_thr_iter (const td_thragent_t *ta, td_thr_iter_f *callback,
/* Test the state.
XXX This is incomplete. */
- if (state != TD_THR_ANY_STATE
- && (state != TD_THR_ZOMBIE || pds.p_exited == 0)
- && (state != TD_THR_RUN || pds.p_exited != 0))
+ if (state != TD_THR_ANY_STATE)
+ continue;
+
+ /* XXX For now we ignore threads which are not running anymore.
+ The reason is that gdb tries to get the registers and fails.
+ In future we should have a special mode of the thread library
+ in which we keep the process around until the actual join
+ operation happened. */
+ if (pds.p_exited != 0)
continue;
/* Yep, it matches. Call the callback function. */
diff --git a/linuxthreads_db/td_thr_get_info.c b/linuxthreads_db/td_thr_get_info.c
index 973323e1d6..606ca81f78 100644
--- a/linuxthreads_db/td_thr_get_info.c
+++ b/linuxthreads_db/td_thr_get_info.c
@@ -43,29 +43,29 @@ td_thr_get_info (const td_thrhandle_t *th, td_thrinfo_t *infop)
descriptor in older versions is not fully initialized. */
if (pds.p_nr == 1)
{
- infop->ti_ta_p = th->th_ta_p;
infop->ti_tid = th->th_ta_p->pthread_threads_max * 2 + 1;
- infop->ti_lid = pds.p_pid;
infop->ti_type = TD_THR_SYSTEM;
infop->ti_state = TD_THR_RUN;
}
else
{
- infop->ti_ta_p = th->th_ta_p;
infop->ti_tid = pds.p_tid;
- infop->ti_lid = pds.p_pid;
infop->ti_tls = (char *) pds.p_specific;
infop->ti_pri = pds.p_priority;
infop->ti_type = TD_THR_USER;
if (pds.p_exited)
+ /* This should not happen. */
infop->ti_state = TD_THR_ZOMBIE;
else
/* XXX For now there is no way to get more information. */
infop->ti_state = TD_THR_RUN;
-
- infop->ti_startfunc = pds.p_start_args.start_routine;
}
+ /* Initialization which are the same in both cases. */
+ infop->ti_lid = pds.p_pid;
+ infop->ti_ta_p = th->th_ta_p;
+ infop->ti_startfunc = pds.p_start_args.start_routine;
+
return TD_OK;
}
diff --git a/linuxthreads_db/td_thr_validate.c b/linuxthreads_db/td_thr_validate.c
index f6f0d9094d..81c3b50214 100644
--- a/linuxthreads_db/td_thr_validate.c
+++ b/linuxthreads_db/td_thr_validate.c
@@ -35,10 +35,6 @@ td_thr_validate (const td_thrhandle_t *th)
{
struct pthread_handle_struct phc;
- if (cnt == 1)
- /* Skip the manager thread. */
- continue;
-
if (ps_pdread (th->th_ta_p->ph, handles, &phc,
sizeof (struct pthread_handle_struct)) != PS_OK)
return TD_ERR; /* XXX Other error value? */