From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10034 invoked by alias); 22 Apr 2009 17:25:36 -0000 Received: (qmail 9999 invoked by uid 22791); 22 Apr 2009 17:25:30 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 22 Apr 2009 17:25:22 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id EA17010B72; Wed, 22 Apr 2009 17:25:19 +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 97CB210B70; Wed, 22 Apr 2009 17:25:19 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1LwgCD-0004Zi-VN; Wed, 22 Apr 2009 13:25:18 -0400 Date: Wed, 22 Apr 2009 17:25:00 -0000 From: Daniel Jacobowitz To: Paul Pluzhnikov Cc: tromey@redhat.com, Thiago Jung Bauermann , gdb-patches ml , Eli Zaretskii Subject: Re: [patch][rfc] Allow GDB to search for the right libthread_db.so.1 Message-ID: <20090422172517.GA17235@caradoc.them.org> Mail-Followup-To: Paul Pluzhnikov , tromey@redhat.com, Thiago Jung Bauermann , gdb-patches ml , Eli Zaretskii References: <1239225742.8871.145.camel@localhost.localdomain> <8ac60eac0904101205h76d8377cv843db8177e74f8af@mail.gmail.com> <8ac60eac0904171213p4c075224x5f5c3661d240f383@mail.gmail.com> <20090420131751.GA25075@caradoc.them.org> <8ac60eac0904200947y2acca97arc1a0fc61530357a0@mail.gmail.com> <20090420170154.GA10112@caradoc.them.org> <8ac60eac0904201019g7ba8056bx5e84e6bfdf5935d8@mail.gmail.com> <20090420180352.GA14206@caradoc.them.org> <8ac60eac0904201208m95d4585k2b09f6b6fe5edb40@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8ac60eac0904201208m95d4585k2b09f6b6fe5edb40@mail.gmail.com> User-Agent: Mutt/1.5.17 (2008-05-11) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-04/txt/msg00596.txt.bz2 On Mon, Apr 20, 2009 at 12:08:54PM -0700, Paul Pluzhnikov wrote: > Previously, dlopen was performed at initialization time, and then > thread_db_ops was pushed when (and only when) td_ta_new returned TD_OK > (checked on attach, and on every new solib). > > If td_ta_new returned TD_NOLIBTHREAD, we assumed that there are no threads > at all (at least not yet), and any other error produced a warning. > > One example where this fails: static LinuxThreads exe on NPTL system: > td_ta_new returns TD_NOLIBTHREAD (which is semi-correct -- no NPTL > libpthread), so no warning is issued; but then GDB doesn't work :-( > > The symbol lookup is there in the new code to firmly establish a point > where threads are known to be present, so we can issue correct warning if > at that point no working libthread_db can be found. ... if we have symbols. > I don't see how to establish that "threads are present" point without > symbol lookup, nor how to keep the proper warning if we don't know for > sure whether they are. If you want to generate a warning when there are threads - not just threads, but also a thread library - and no matching libthread_db, then I suppose this is the only way. Personally, I'd rather ditch the warning for static binaries. Check the shared library list for libpthread if all available libthread_db's have failed, and if there is one, warn then. Any thoughts on that? Otherwise, I won't object to what you've got. I am just generally dissatisfied with hard-coding a list of symbols from the implementation. e.g. uClibc could legitimately use different names. -- Daniel Jacobowitz CodeSourcery