From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20183 invoked by alias); 23 Oct 2008 17:14:08 -0000 Received: (qmail 20171 invoked by uid 22791); 23 Oct 2008 17:14:07 -0000 X-Spam-Check-By: sourceware.org Received: from el-out-1112.google.com (HELO el-out-1112.google.com) (209.85.162.179) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 23 Oct 2008 17:13:15 +0000 Received: by el-out-1112.google.com with SMTP id o28so172634ele.3 for ; Thu, 23 Oct 2008 10:13:12 -0700 (PDT) Received: by 10.90.119.20 with SMTP id r20mr843737agc.5.1224781991915; Thu, 23 Oct 2008 10:13:11 -0700 (PDT) Received: by 10.90.89.3 with HTTP; Thu, 23 Oct 2008 10:13:11 -0700 (PDT) Message-ID: <4ced24c0810231013l5957537dr1272d782bb4e391b@mail.gmail.com> Date: Thu, 23 Oct 2008 17:14:00 -0000 From: "Lukasz Lempart" To: gdb@sourceware.org Subject: Re: gdb and cloned process In-Reply-To: <20081023030548.GA21266@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <4ced24c0810221709u17575bf3s73994724c456e956@mail.gmail.com> <20081023030548.GA21266@caradoc.them.org> 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/msg00110.txt.bz2 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.