summary refs log tree commit diff
path: root/linuxthreads_db
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-04-13 04:12:32 +0000
committerUlrich Drepper <drepper@redhat.com>2001-04-13 04:12:32 +0000
commitc4103b34805bc2694ec7232005eb9cf66d3f7c67 (patch)
tree08a6dbd40144f0a4294d08d7d742c62c1ed75f3c /linuxthreads_db
parenta08877d0e029ed62dd55296a824d51355777f276 (diff)
downloadglibc-c4103b34805bc2694ec7232005eb9cf66d3f7c67.tar.gz
glibc-c4103b34805bc2694ec7232005eb9cf66d3f7c67.tar.xz
glibc-c4103b34805bc2694ec7232005eb9cf66d3f7c67.zip
Update.
2001-04-12  Ulrich Drepper  <drepper@redhat.com>

	* sysdeps/ia64/Dist: Add elf/entry.h.

	* iconvdata/Makefile (distribute): Add TESTS2.
Diffstat (limited to 'linuxthreads_db')
-rw-r--r--linuxthreads_db/ChangeLog5
-rw-r--r--linuxthreads_db/td_ta_map_id2thr.c5
-rw-r--r--linuxthreads_db/td_thr_validate.c10
3 files changed, 17 insertions, 3 deletions
diff --git a/linuxthreads_db/ChangeLog b/linuxthreads_db/ChangeLog
index cdaab18f0c..e05a94f9f5 100644
--- a/linuxthreads_db/ChangeLog
+++ b/linuxthreads_db/ChangeLog
@@ -1,3 +1,8 @@
+2001-04-12  Ulrich Drepper  <drepper@redhat.com>
+
+	* td_ta_map_id2thr.c: If thread terminated return TD_NOTHR.
+	* td_thr_validate.c: Likewise.
+
 2001-04-04  Ulrich Drepper  <drepper@redhat.com>
 
 	* td_thr_getfpregs.c: If p_pid is zero use ps_getpid().
diff --git a/linuxthreads_db/td_ta_map_id2thr.c b/linuxthreads_db/td_ta_map_id2thr.c
index 6fb1ba96aa..7c9c7c14fd 100644
--- a/linuxthreads_db/td_ta_map_id2thr.c
+++ b/linuxthreads_db/td_ta_map_id2thr.c
@@ -1,5 +1,5 @@
 /* Map thread ID to thread handle.
-   Copyright (C) 1999 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999.
 
@@ -55,6 +55,9 @@ td_ta_map_id2thr (const td_thragent_t *ta, pthread_t pt, td_thrhandle_t *th)
   if (pds.p_tid != pt)
     return TD_BADTH;
 
+  if (pds.p_terminated != 0)
+    return TD_NOTHR;
+
   /* Create the `td_thrhandle_t' object.  */
   th->th_ta_p = (td_thragent_t *) ta;
   th->th_unique = phc.h_descr;
diff --git a/linuxthreads_db/td_thr_validate.c b/linuxthreads_db/td_thr_validate.c
index 81c3b50214..7ca3af20b6 100644
--- a/linuxthreads_db/td_thr_validate.c
+++ b/linuxthreads_db/td_thr_validate.c
@@ -1,5 +1,5 @@
 /* Validate a thread handle.
-   Copyright (C) 1999 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999.
 
@@ -41,9 +41,15 @@ td_thr_validate (const td_thrhandle_t *th)
 
       if (phc.h_descr != NULL && phc.h_descr == th->th_unique)
 	{
+	  struct _pthread_descr_struct pds;
+
+	  if (ps_pdread (th->th_ta_p->ph, phc.h_descr, &pds,
+			 th->th_ta_p->sizeof_descr) != PS_OK)
+	    return TD_ERR;	/* XXX Other error value?  */
+
 	  /* XXX There should be another test using the TID but this is
 	     currently not available.  */
-	  return TD_OK;
+	  return pds.p_terminated != 0 ? TD_NOTHR : TD_OK;
 	}
     }