From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16614 invoked by alias); 23 Oct 2008 20:30:30 -0000 Received: (qmail 16585 invoked by uid 22791); 23 Oct 2008 20:30:29 -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 20:29:58 +0000 Received: by el-out-1112.google.com with SMTP id o28so251210ele.3 for ; Thu, 23 Oct 2008 13:29:55 -0700 (PDT) Received: by 10.90.100.20 with SMTP id x20mr976998agb.109.1224793795646; Thu, 23 Oct 2008 13:29:55 -0700 (PDT) Received: by 10.90.89.3 with HTTP; Thu, 23 Oct 2008 13:29:55 -0700 (PDT) Message-ID: <4ced24c0810231329w4a1e4788qaeac176afff1fc4e@mail.gmail.com> Date: Thu, 23 Oct 2008 20:30:00 -0000 From: "Lukasz Lempart" To: "Michael Snyder" Subject: Re: gdb and cloned process Cc: gdb@sourceware.org In-Reply-To: <4900C1CC.20002@vmware.com> 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> <4900C1CC.20002@vmware.com> 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/msg00114.txt.bz2 On Thu, Oct 23, 2008 at 11:26 AM, Michael Snyder wrote: > 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 currently a way to disable thread debugging in gdb? >> >> Not really. You might be able to preload a dummy libthread_db.so.1 >> that always failed to detect new threads. > > What if you strip libthread.so? Isn't that supposed to > cause thread debugging to fail? > Stripping libthread_db.so seems to do the trick. Thanks for the suggestion. Keeping both version of the library around and just changing LD_LIBRARY_PATH to point to the one I want seems to be the most portable way to handle debugging both the original and the cloned process. A gdb command to turn on/off thread debugging would be very nice to have though.