From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23635 invoked by alias); 23 Oct 2008 17:19:13 -0000 Received: (qmail 23627 invoked by uid 22791); 23 Oct 2008 17:19:12 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 23 Oct 2008 17:18:33 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id AA25710AFE; Thu, 23 Oct 2008 17:18:30 +0000 (GMT) Received: from caradoc.them.org (209.195.188.212.nauticom.net [209.195.188.212]) by nan.false.org (Postfix) with ESMTP id 9A2E510AEE; Thu, 23 Oct 2008 17:18:30 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1Kt3pN-00013T-Tp; Thu, 23 Oct 2008 13:18:29 -0400 Date: Thu, 23 Oct 2008 17:19:00 -0000 From: Daniel Jacobowitz To: Lukasz Lempart Cc: gdb@sourceware.org Subject: Re: gdb and cloned process Message-ID: <20081023171829.GA4033@caradoc.them.org> Mail-Followup-To: Lukasz Lempart , gdb@sourceware.org References: <4ced24c0810221709u17575bf3s73994724c456e956@mail.gmail.com> <20081023030548.GA21266@caradoc.them.org> <4ced24c0810231013l5957537dr1272d782bb4e391b@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4ced24c0810231013l5957537dr1272d782bb4e391b@mail.gmail.com> User-Agent: Mutt/1.5.17 (2008-05-11) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-10/txt/msg00111.txt.bz2 On Thu, Oct 23, 2008 at 10:13:11AM -0700, Lukasz Lempart wrote: > On Wed, Oct 22, 2008 at 8:05 PM, Daniel Jacobowitz wrote: > > On Wed, Oct 22, 2008 at 05:09:32PM -0700, Lukasz Lempart wrote: > >> How does gdb (through libthread_db) figure out what threads belong to a process? > > > > The thread library maintains an internal list of threads. If you've > > cloned the process, without telling the C library about that, you're > > going to end up with the same list of threads; so the behavior you > > describe is not surprising. > > > Is there a way to do this? I can't seem to find anything in > libthread_db that would allow me to do this. Furthermore, the two > processes share their entire address space, so any change made to the > internal list of threads for one process would have impact on the > other one. Not that I can think of. You'd have to hack up gdb a bit. -- Daniel Jacobowitz CodeSourcery