Update.
authorUlrich Drepper <drepper@redhat.com>
Tue, 16 Jul 2002 20:18:42 +0000 (20:18 +0000)
committerUlrich Drepper <drepper@redhat.com>
Tue, 16 Jul 2002 20:18:42 +0000 (20:18 +0000)
2002-07-16  Ulrich Drepper  <drepper@redhat.com>

* locales/th_TH: Change tel_dom_fmt.
Patch by Theppitak Karoonboonyanan <thep@links.nectec.or.th>.

linuxthreads_db/ChangeLog
linuxthreads_db/td_thr_clear_event.c
linuxthreads_db/td_thr_event_enable.c
linuxthreads_db/td_thr_event_getmsg.c
linuxthreads_db/td_thr_set_event.c
linuxthreads_db/td_thr_setfpregs.c
linuxthreads_db/td_thr_setgregs.c
linuxthreads_db/td_thr_tsd.c
linuxthreads_db/td_thr_validate.c
localedata/ChangeLog
localedata/locales/th_TH

index 1d1f8d7..6cd9757 100644 (file)
@@ -1,3 +1,15 @@
+2002-07-16  Ulrich Drepper  <drepper@redhat.com>
+
+       * td_thr_clear_event.c: Yet more changes to help with TLS-enabled
+       libpthread.
+       * td_thr_event_enable.c: Likewise.
+       * td_thr_event_getmsg.c: Likewise.
+       * td_thr_set_event.c: Likewise.
+       * td_thr_setfpregs.c: Likewise.
+       * td_thr_setgregs.c: Likewise.
+       * td_thr_tsd.c: Likewise.
+       * td_thr_validate.c: Likewise.
+
 2002-07-15  Ulrich Drepper  <drepper@redhat.com>
 
        * td_ta_thr_iter.c: Some more changes to enable using TLS-enabled
index 57cb821..c027fc0 100644 (file)
@@ -1,5 +1,5 @@
 /* Disable specific event for thread.
-   Copyright (C) 1999, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999.
 
@@ -33,6 +33,11 @@ td_thr_clear_event (th, event)
 
   LOG ("td_thr_clear_event");
 
+  /* If the thread descriptor has not yet been constructed do not do
+     anything.  */
+  if (th->th_unique == NULL)
+    return TD_OK;
+
   /* Write the new value into the thread data structure.  */
   if (ps_pdread (th->th_ta_p->ph,
                 ((char *) th->th_unique
index d6ec2a9..b6ec4d0 100644 (file)
@@ -1,5 +1,5 @@
 /* Enable event process-wide.
-   Copyright (C) 1999, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999.
 
@@ -31,12 +31,13 @@ td_thr_event_enable (th, onoff)
   LOG ("td_thr_event_enable");
 
   /* Write the new value into the thread data structure.  */
-if (th->th_unique != NULL)
-  if (ps_pdwrite (th->th_ta_p->ph,
-                 ((char *) th->th_unique
-                  + offsetof (struct _pthread_descr_struct, p_report_events)),
-                 &onoff, sizeof (int)) != PS_OK)
-    return TD_ERR;     /* XXX Other error value?  */
+  if (th->th_unique != NULL)
+    if (ps_pdwrite (th->th_ta_p->ph,
+                   ((char *) th->th_unique
+                    + offsetof (struct _pthread_descr_struct,
+                                p_report_events)),
+                   &onoff, sizeof (int)) != PS_OK)
+      return TD_ERR;   /* XXX Other error value?  */
 
   return TD_OK;
 }
index 6a10cdc..bf4ddd4 100644 (file)
@@ -1,5 +1,5 @@
 /* Retrieve event.
-   Copyright (C) 1999, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999.
 
@@ -31,6 +31,11 @@ td_thr_event_getmsg (const td_thrhandle_t *th, td_event_msg_t *msg)
 
   LOG ("td_thr_event_getmsg");
 
+  /* If the thread descriptor has not yet been created there cannot be
+     any event.  */
+  if (th->th_unique == NULL)
+    return TD_NOMSG;
+
   /* Read the even structure from the target.  */
   if (ps_pdread (th->th_ta_p->ph,
                 ((char *) th->th_unique
index b90a6a6..205b445 100644 (file)
@@ -1,5 +1,5 @@
 /* Enable specific event for thread.
-   Copyright (C) 1999, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999.
 
@@ -33,6 +33,11 @@ td_thr_set_event (th, event)
 
   LOG ("td_thr_set_event");
 
+  /* What shall we do if no thread descriptor exists but the user
+     wants to set an event?  */
+  if (th->th_unique == NULL)
+    return TD_NOTALLOC;
+
   /* Write the new value into the thread data structure.  */
   if (ps_pdread (th->th_ta_p->ph,
                 ((char *) th->th_unique
index 0d4fce5..e4d9ec6 100644 (file)
@@ -1,5 +1,5 @@
 /* Set a thread's floating-point register set.
-   Copyright (C) 1999, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999.
 
 td_err_e
 td_thr_setfpregs (const td_thrhandle_t *th, const prfpregset_t *fpregs)
 {
-  struct _pthread_descr_struct pds;
+  struct _pthread_descr_struct pds = { .p_terminated = 0, .p_pid = 0 };
 
   LOG ("td_thr_setfpregs");
 
   /* We have to get the state and the PID for this thread.  */
-  if (ps_pdread (th->th_ta_p->ph, th->th_unique, &pds,
+  if (th->th_unique != NULL
+      && ps_pdread (th->th_ta_p->ph, th->th_unique, &pds,
                  sizeof (struct _pthread_descr_struct)) != PS_OK)
     return TD_ERR;
 
index 3cf6539..8c021a4 100644 (file)
@@ -1,5 +1,5 @@
 /* Set a thread's general register set.
-   Copyright (C) 1999, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999.
 
 td_err_e
 td_thr_setgregs (const td_thrhandle_t *th, prgregset_t gregs)
 {
-  struct _pthread_descr_struct pds;
+  struct _pthread_descr_struct pds = { .p_terminated = 0, .p_pid = 0 };
 
   LOG ("td_thr_setgregs");
 
   /* We have to get the state and the PID for this thread.  */
-  if (ps_pdread (th->th_ta_p->ph, th->th_unique, &pds,
+  if (th->th_unique != NULL
+      && ps_pdread (th->th_ta_p->ph, th->th_unique, &pds,
                  sizeof (struct _pthread_descr_struct)) != PS_OK)
     return TD_ERR;
 
index aa362fe..95dec46 100644 (file)
@@ -36,6 +36,11 @@ td_thr_tsd (const td_thrhandle_t *th, const thread_key_t tk, void **data)
 
   LOG ("td_thr_tsd");
 
+  /* If there is no thread descriptor there cannot be any thread
+     specific data.  */
+  if (th->th_unique == NULL)
+    return TD_BADKEY;
+
   /* Get the thread descriptor.  */
   if (ps_pdread (th->th_ta_p->ph, th->th_unique, &pds,
                 sizeof (struct _pthread_descr_struct)) != PS_OK)
index fcce270..8334ef7 100644 (file)
@@ -31,6 +31,11 @@ td_thr_validate (const td_thrhandle_t *th)
 
   LOG ("td_thr_validate");
 
+  /* A special case: if the program just starts up the handle is
+     NULL.  */
+  if (th->th_unique == NULL)
+    return TD_OK;
+
   /* Now get all descriptors, one after the other.  */
   for (cnt = 0; cnt < pthread_threads_max; ++cnt, ++handles)
     {
index 4f3c54c..e399f03 100644 (file)
@@ -1,3 +1,8 @@
+2002-07-16  Ulrich Drepper  <drepper@redhat.com>
+
+       * locales/th_TH: Change tel_dom_fmt.
+       Patch by Theppitak Karoonboonyanan <thep@links.nectec.or.th>.
+
 2002-07-11  Ulrich Drepper  <drepper@redhat.com>
 
        * charmaps/ISO-8859-11: New file.
index dae8d15..c3592b9 100644 (file)
@@ -933,7 +933,7 @@ END LC_PAPER
 LC_TELEPHONE
 tel_int_fmt    "<U002B><U0025><U0063><U0020><U0025><U0061><U0020><U0025>/
 <U006C>"
-tel_dom_fmt    "<U0028><U0025><U0041><U0029><U0025><U006C>"
+tel_dom_fmt    "<U0030><U002D><U0025><U0061><U0025><U006C>"
 int_select     "<U0030><U0030><U0031>"
 int_prefix     "<U0036><U0036>"
 END LC_TELEPHONE