From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8706 invoked by alias); 13 Sep 2006 00:33:55 -0000 Received: (qmail 8697 invoked by uid 22791); 13 Sep 2006 00:33:54 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Wed, 13 Sep 2006 00:33:50 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1GNIhH-0006Kj-2t; Tue, 12 Sep 2006 20:33:47 -0400 Date: Wed, 13 Sep 2006 00:33:00 -0000 From: Daniel Jacobowitz To: Joel Brobecker Cc: gdb@sources.redhat.com Subject: Re: (linux/threads) Interesting side-effect of "auto-solib-add 0" Message-ID: <20060913003347.GA24280@nevyn.them.org> Mail-Followup-To: Joel Brobecker , gdb@sources.redhat.com References: <20060913002712.GF24293@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060913002712.GF24293@adacore.com> User-Agent: Mutt/1.5.13 (2006-08-11) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-09/txt/msg00066.txt.bz2 On Tue, Sep 12, 2006 at 05:27:13PM -0700, Joel Brobecker wrote: > It seems to me that we should be able to fix this by adding an observer > of the `solib_loaded' event to replace the hook that linux-thread-db > installed. I actually gave it a try, using the sources from CVS, and > found out something surprising: Although the solib_loaded observer > I just created gets called as expected, the linux thread layers does > not detect that threads are in use: You've missed the pertinent fact here. We're not waiting for libpthread.so to be loaded just for kicks! The only way libthread_db can operate is by querying back through GDB for the locations of symbols in the thread library. If we don't load that objfile, then it can't initialize. > The only difference I can see between the two runs is that symbols > are read in one case, and not read in the other case. Is libthread_db.so > dependent on having the symbol table being loaded or something of that > sort? Yes. Don't load libpthread, won't get threads. -- Daniel Jacobowitz CodeSourcery