From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13838 invoked by alias); 27 Jun 2002 15:13:09 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 13808 invoked from network); 27 Jun 2002 15:13:07 -0000 Received: from unknown (HELO localhost.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 27 Jun 2002 15:13:07 -0000 Received: from ges.redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id B31B13C44; Thu, 27 Jun 2002 11:13:05 -0400 (EDT) Message-ID: <3D1B2B81.7020506@ges.redhat.com> Date: Thu, 27 Jun 2002 08:13:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.0) Gecko/20020613 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jim Blandy Cc: Daniel Jacobowitz , Andrew Cagney , James Cownie , gdb@sources.redhat.com Subject: Re: GDB support for thread-local storage References: <20020625154201.GB17370@branoic.them.org> <17MsdN-0Qe-00@etnus.com> <20020625155555.GA18083@branoic.them.org> <3D1897DA.90405@cygnus.com> <20020625170147.GB19950@branoic.them.org> <3D1A78E4.5060904@ges.redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-06/txt/msg00295.txt.bz2 > Andrew Cagney writes: > >> > Doesn't libthread_db read `struct _pthread_descr_struct' from the >> > linuxthreads library in the inferior, rather than knowing the layout >> > itself? So it's actually the inferior's linuxthreads library that >> > describes its own structures' layout. > >> >> The structure layout will have been compiled into libthread-db.a. It >> implicitly knows the layout itself. > > > I think you're wrong here. Could you show me the code? Sorry, you've lost me. http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/linuxthreads/descr.h?rev=1.3&content-type=text/x-cvsweb-markup&cvsroot=glibc > struct _pthread_descr_struct { > /* XXX Remove this union for IA-64 style TLS module */ > union { > struct { > void *tcb; /* Pointer to the TCB. This is not always > the address of this thread descriptor. */ > union dtv *dtvp; > pthread_descr self; /* Pointer to this structure */ > } data; > void *__padding[16]; > } p_header; > pthread_descr p_nextlive, p_prevlive; > /* Double chaining of active threads */ > pthread_descr p_nextwaiting; /* Next element in the queue holding the thr */ > pthread_descr p_nextlock; /* can be on a queue and waiting on a lock */ > pthread_t p_tid; /* Thread identifier */ > int p_pid; /* PID of Unix process */ Note the use of ISA/ABI dependant data types such as ``int'', ``void *'', ... As such they are implicitly included in and compiled into libhread-db.a enjoy, Andrew