summary refs log tree commit diff
path: root/nptl_db
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-12-13 09:45:50 +0000
committerRoland McGrath <roland@gnu.org>2002-12-13 09:45:50 +0000
commitf99580795314fd943996662e6d2fb63929e88d4c (patch)
treef74f7e749c139640857a0385f5e1e7a4d54a15a2 /nptl_db
parent1a1fa20034f6d454f8d23e382367def86d92614c (diff)
downloadglibc-f99580795314fd943996662e6d2fb63929e88d4c.tar.gz
glibc-f99580795314fd943996662e6d2fb63929e88d4c.tar.xz
glibc-f99580795314fd943996662e6d2fb63929e88d4c.zip
2002-12-12 Roland McGrath <roland@redhat.com>
	* td_ta_thr_iter.c (iterate_thread_list): Handle special case of
	uninitialized __stack_user (zeros), hard-wire just the main thread.
Diffstat (limited to 'nptl_db')
-rw-r--r--nptl_db/td_ta_thr_iter.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/nptl_db/td_ta_thr_iter.c b/nptl_db/td_ta_thr_iter.c
index 87fec01e8b..68b5427a7d 100644
--- a/nptl_db/td_ta_thr_iter.c
+++ b/nptl_db/td_ta_thr_iter.c
@@ -38,6 +38,16 @@ iterate_thread_list (const td_thragent_t *ta, td_thr_iter_f *callback,
   if (ps_pdread (ta->ph, head, &list, sizeof (list_t)) != PS_OK)
     return TD_ERR;	/* XXX Other error value?  */
 
+  if (list.next == 0 && list.prev == 0 && head == ta->stack_user)
+    {
+      /* __pthread_initialize_minimal has not run.
+	 There is just the main thread to return.  */
+      td_thrhandle_t th;
+      td_err_e err = td_ta_map_lwp2thr (ta, ps_getpid (ta->ph), &th);
+      return (err != TD_OK ? err
+	      : callback (&th, cbdata_p) != 0 ? TD_DBERR : TD_OK);
+    }
+
   while (list.next != head)
     {
       psaddr_t addr = ((psaddr_t) list.next