This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: debugging threaded apps. thread ID missing in corefile.


   Date: Tue, 7 Jun 2005 09:10:22 -0400
   From: Daniel Jacobowitz <drow@false.org>

   > > Not really.  The ID is a pointer above 0x80000000, used by the
   > > implementation.
   > 
   > Well, then perhaps we should display the thread ID in hex?

   Hmm.  I wouldn't object to this.  The number is opaque to the user
   code; for LinuxThreads it is an encoded index into an array (usually
   between 0 and 64k; the first few threads are numbered around 32k and
   16k).  That looks plausible in hex or in decimal.  For NPTL they are
   pointers and would look more plausible in hex.

The number isn't really opaque to the user.  The numbers have type
`pthread_t' and can be printed by the user when debugging his program.
It's the pthread_t type that is opaque.  Ideally we'd use the the
`pthread_t' type for the formatting of these values.  But AFAIC hex is
a good default.

Mark


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]