LinuxThreads libthread_db 64-bit fixes

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

LinuxThreads libthread_db 64-bit fixes

Daniel Jacobowitz-2
I don't know if this will trigger on any other platforms, but it's necessary
if you use linuxthreads on x86_64.  td_thr_events_t is 8 bytes,
td_thrhandle_t is 16 bytes.  It looks like the same problem would exist on
any 64-bit platform.

Checked in; Roland, how much discretion have I got on the 2.3 branch for
stuff in ports?

--
Daniel Jacobowitz
CodeSourcery, LLC

2005-11-02  Daniel Jacobowitz  <[hidden email]>

        * td_ta_clear_event.c (td_ta_clear_event): Correct arguments to
        sizeof.
        * td_ta_set_event.c (td_ta_set_event): Likewise.
        * td_thr_clear_event.c (td_thr_clear_event): Likewise.
        * td_thr_set_event.c (td_thr_set_event): Likewise.

Index: glibc/linuxthreads_db/td_ta_clear_event.c
===================================================================
RCS file: /cvs/glibc/ports/linuxthreads_db/td_ta_clear_event.c,v
retrieving revision 1.4
diff -u -p -r1.4 glibc/linuxthreads_db/td_ta_clear_event.c
--- glibc/linuxthreads_db/td_ta_clear_event.c 28 Dec 2001 16:41:29 -0000 1.4
+++ glibc/linuxthreads_db/td_ta_clear_event.c 2 Nov 2005 19:25:05 -0000
@@ -1,5 +1,5 @@
 /* Globally disable events.
-   Copyright (C) 1999, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2001, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <[hidden email]>, 1999.
 
@@ -37,7 +37,7 @@ td_ta_clear_event (ta, event)
 
   /* Write the new value into the thread data structure.  */
   if (ps_pdread (ta->ph, ta->pthread_threads_eventsp,
- &old_event, sizeof (td_thrhandle_t)) != PS_OK)
+ &old_event, sizeof (td_thr_events_t)) != PS_OK)
     return TD_ERR; /* XXX Other error value?  */
 
   /* Remove the set bits in.  */
@@ -46,7 +46,7 @@ td_ta_clear_event (ta, event)
 
   /* Write the new value into the thread data structure.  */
   if (ps_pdwrite (ta->ph, ta->pthread_threads_eventsp,
-  &old_event, sizeof (td_thrhandle_t)) != PS_OK)
+  &old_event, sizeof (td_thr_events_t)) != PS_OK)
     return TD_ERR; /* XXX Other error value?  */
 
   return TD_OK;
Index: glibc/linuxthreads_db/td_ta_set_event.c
===================================================================
RCS file: /cvs/glibc/ports/linuxthreads_db/td_ta_set_event.c,v
retrieving revision 1.5
diff -u -p -r1.5 glibc/linuxthreads_db/td_ta_set_event.c
--- glibc/linuxthreads_db/td_ta_set_event.c 28 Dec 2001 16:41:29 -0000 1.5
+++ glibc/linuxthreads_db/td_ta_set_event.c 2 Nov 2005 19:25:06 -0000
@@ -1,5 +1,5 @@
 /* Globally enable events.
-   Copyright (C) 1999, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2001, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <[hidden email]>, 1999.
 
@@ -37,7 +37,7 @@ td_ta_set_event (ta, event)
 
   /* Write the new value into the thread data structure.  */
   if (ps_pdread (ta->ph, ta->pthread_threads_eventsp,
- &old_event, sizeof (td_thrhandle_t)) != PS_OK)
+ &old_event, sizeof (td_thr_events_t)) != PS_OK)
     return TD_ERR; /* XXX Other error value?  */
 
   /* Or the new bits in.  */
@@ -46,7 +46,7 @@ td_ta_set_event (ta, event)
 
   /* Write the new value into the thread data structure.  */
   if (ps_pdwrite (ta->ph, ta->pthread_threads_eventsp,
-  &old_event, sizeof (td_thrhandle_t)) != PS_OK)
+  &old_event, sizeof (td_thr_events_t)) != PS_OK)
     return TD_ERR; /* XXX Other error value?  */
 
   return TD_OK;
Index: glibc/linuxthreads_db/td_thr_clear_event.c
===================================================================
RCS file: /cvs/glibc/ports/linuxthreads_db/td_thr_clear_event.c,v
retrieving revision 1.5
diff -u -p -r1.5 glibc/linuxthreads_db/td_thr_clear_event.c
--- glibc/linuxthreads_db/td_thr_clear_event.c 16 Jul 2002 19:36:15 -0000 1.5
+++ glibc/linuxthreads_db/td_thr_clear_event.c 2 Nov 2005 19:25:06 -0000
@@ -1,5 +1,5 @@
 /* Disable specific event for thread.
-   Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <[hidden email]>, 1999.
 
@@ -43,7 +43,7 @@ td_thr_clear_event (th, event)
  ((char *) th->th_unique
   + offsetof (struct _pthread_descr_struct,
       p_eventbuf.eventmask)),
- &old_event, sizeof (td_thrhandle_t)) != PS_OK)
+ &old_event, sizeof (td_thr_events_t)) != PS_OK)
     return TD_ERR; /* XXX Other error value?  */
 
   /* Remove the set bits in.  */
@@ -55,7 +55,7 @@ td_thr_clear_event (th, event)
   ((char *) th->th_unique
    + offsetof (struct _pthread_descr_struct,
        p_eventbuf.eventmask)),
-  &old_event, sizeof (td_thrhandle_t)) != PS_OK)
+  &old_event, sizeof (td_thr_events_t)) != PS_OK)
     return TD_ERR; /* XXX Other error value?  */
 
   return TD_OK;
Index: glibc/linuxthreads_db/td_thr_set_event.c
===================================================================
RCS file: /cvs/glibc/ports/linuxthreads_db/td_thr_set_event.c,v
retrieving revision 1.6
diff -u -p -r1.6 glibc/linuxthreads_db/td_thr_set_event.c
--- glibc/linuxthreads_db/td_thr_set_event.c 16 Jul 2002 19:36:15 -0000 1.6
+++ glibc/linuxthreads_db/td_thr_set_event.c 2 Nov 2005 19:25:06 -0000
@@ -1,5 +1,5 @@
 /* Enable specific event for thread.
-   Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <[hidden email]>, 1999.
 
@@ -43,7 +43,7 @@ td_thr_set_event (th, event)
  ((char *) th->th_unique
   + offsetof (struct _pthread_descr_struct,
       p_eventbuf.eventmask)),
- &old_event, sizeof (td_thrhandle_t)) != PS_OK)
+ &old_event, sizeof (td_thr_events_t)) != PS_OK)
     return TD_ERR; /* XXX Other error value?  */
 
   /* Or the new bits in.  */
@@ -55,7 +55,7 @@ td_thr_set_event (th, event)
   ((char *) th->th_unique
    + offsetof (struct _pthread_descr_struct,
        p_eventbuf.eventmask)),
-  &old_event, sizeof (td_thrhandle_t)) != PS_OK)
+  &old_event, sizeof (td_thr_events_t)) != PS_OK)
     return TD_ERR; /* XXX Other error value?  */
 
   return TD_OK;
Reply | Threaded
Open this post in threaded view
|

Re: LinuxThreads libthread_db 64-bit fixes

Roland McGrath
> Checked in; Roland, how much discretion have I got on the 2.3 branch for
> stuff in ports?

Everything in glibc-2_3-branch of the main tree goes through the same
procedures, whether it's deprecated in the trunk now or not.  For
linuxthreads changes I am not likely to have any objection to putting them
on.  But you should file a bugzilla report and give me the number to let me
deal with putting it on the branch.  This is how I keep track of things.


Thanks,
Roland
Reply | Threaded
Open this post in threaded view
|

Re: LinuxThreads libthread_db 64-bit fixes

Daniel Jacobowitz-2
On Thu, Nov 03, 2005 at 01:42:54PM -0800, Roland McGrath wrote:
> > Checked in; Roland, how much discretion have I got on the 2.3 branch for
> > stuff in ports?
>
> Everything in glibc-2_3-branch of the main tree goes through the same
> procedures, whether it's deprecated in the trunk now or not.  For
> linuxthreads changes I am not likely to have any objection to putting them
> on.  But you should file a bugzilla report and give me the number to let me
> deal with putting it on the branch.  This is how I keep track of things.

So, to be clear: even though there is now a 2.3 branch in the ports
repository copy of linuxthreads, and one in the old glibc repository,
the one in the glibc repository will be used for the 2.3.6 release?

I was assuming that the one in the ports repository would be used.

--
Daniel Jacobowitz
CodeSourcery, LLC
Reply | Threaded
Open this post in threaded view
|

Re: LinuxThreads libthread_db 64-bit fixes

Roland McGrath
> So, to be clear: even though there is now a 2.3 branch in the ports
> repository copy of linuxthreads

There is not supposed to be one, and isn't one as far as I can tell.
Reply | Threaded
Open this post in threaded view
|

Re: LinuxThreads libthread_db 64-bit fixes

Daniel Jacobowitz-2
On Thu, Nov 03, 2005 at 03:08:32PM -0800, Roland McGrath wrote:
> > So, to be clear: even though there is now a 2.3 branch in the ports
> > repository copy of linuxthreads
>
> There is not supposed to be one, and isn't one as far as I can tell.

Oh - you kept all the history but not the tags.  I didn't even think to
check.

--
Daniel Jacobowitz
CodeSourcery, LLC
Reply | Threaded
Open this post in threaded view
|

Re: LinuxThreads libthread_db 64-bit fixes

Roland McGrath
> Oh - you kept all the history but not the tags.  I didn't even think to
> check.

Yes, that's how I've done everything I moved over to ports.