From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10613 invoked by alias); 12 Aug 2002 15:29:06 -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 10563 invoked from network); 12 Aug 2002 15:29:01 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 12 Aug 2002 15:29:01 -0000 Received: from int-mx2.corp.redhat.com (nat-pool-rdu.redhat.com [172.16.52.200] (may be forged)) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id g7CFFTl02005 for ; Mon, 12 Aug 2002 11:15:29 -0400 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx2.corp.redhat.com (8.11.6/8.11.6) with ESMTP id g7CFSwu00361; Mon, 12 Aug 2002 11:28:59 -0400 Received: from romulus.sfbay.redhat.com (remus.sfbay.redhat.com [172.16.27.252]) by potter.sfbay.redhat.com (8.11.6/8.11.6) with ESMTP id g7CFSve11345; Mon, 12 Aug 2002 08:28:57 -0700 Received: (from kev@localhost) by romulus.sfbay.redhat.com (8.11.6/8.11.6) id g7CFSu631779; Mon, 12 Aug 2002 08:28:56 -0700 Date: Mon, 12 Aug 2002 08:29:00 -0000 From: Kevin Buettner Message-Id: <1020812152856.ZM31778@localhost.localdomain> In-Reply-To: Zheng Jian-Ming "Re: about lin-lwp.c" (Aug 12, 12:06am) References: <20020811155249.GA19815@cissol7.cis.nctu.edu.tw> <20020811160636.GA20079@cissol7.cis.nctu.edu.tw> To: Zheng Jian-Ming , gdb@sources.redhat.com Subject: Re: about lin-lwp.c MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-08/txt/msg00096.txt.bz2 > Alos in gdb/lin-lwp.c, does "multi-threads" for GNU/Linux mean > multile LWPs (lightweight process ids), one PID (process id)? I don't understand the question well enough to give a yes or no answer. lin-lwp.c concerns itself with LWPs. On GNU/Linux, an LWP is just a process that shares its address space other LWPs. If you obtain a list of processes via the ``ps'' command, you'll see LWPs in addition to pure processes (which don't share their address space). When GDB wants to start, stop, or interrogate an LWP it does so via the very same facilities that are used for processes. At the moment, on GNU/Linux, there is a one-to-one mapping between threads and lwps. There is a library, libthread_db.so, which is used by GDB's thread-db.c to obtain the mapping from lwps to threads and vice versa. If you want to understand GDB's GNU/Linux thread support, you must look at lin-lwp.c, thread-db.c, and proc-service.c. (There are some other more generic files that you'll need to look at too.) There is a comment near the top of lin-lwp.c which suggests that lin-lwp.c can supply support for multi-threaded applications that don't have the support of a threads library. To best of my knowledge, this is not the case. (The comment in question may have been true at one time, or it may simply express the hopes of the author in this regard.) > I don't need to handle the TIDs (thread ids), do I? I don't know. What are you trying to do? Kevin