From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10610 invoked by alias); 23 Apr 2009 01:10:22 -0000 Received: (qmail 10596 invoked by uid 22791); 23 Apr 2009 01:10:20 -0000 X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_102,J_CHICKENPOX_52,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.45.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 23 Apr 2009 01:10:15 +0000 Received: from spaceape8.eur.corp.google.com (spaceape8.eur.corp.google.com [172.28.16.142]) by smtp-out.google.com with ESMTP id n3N1A4qN025232 for ; Wed, 22 Apr 2009 18:10:04 -0700 Received: from qyk39 (qyk39.prod.google.com [10.241.83.167]) by spaceape8.eur.corp.google.com with ESMTP id n3N19WUA025119 for ; Wed, 22 Apr 2009 18:10:02 -0700 Received: by qyk39 with SMTP id 39so603441qyk.26 for ; Wed, 22 Apr 2009 18:10:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.84.201 with SMTP id k9mr325619qcl.84.1240449001942; Wed, 22 Apr 2009 18:10:01 -0700 (PDT) In-Reply-To: <20090422172517.GA17235@caradoc.them.org> References: <1239225742.8871.145.camel@localhost.localdomain> <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> <20090422172517.GA17235@caradoc.them.org> Date: Thu, 23 Apr 2009 01:10:00 -0000 Message-ID: <8ac60eac0904221810x24763ecaj4a888927b766e7f7@mail.gmail.com> Subject: Re: [patch][rfc] Allow GDB to search for the right libthread_db.so.1 From: Paul Pluzhnikov To: Paul Pluzhnikov , tromey@redhat.com, Thiago Jung Bauermann , gdb-patches ml , Eli Zaretskii Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true 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/msg00629.txt.bz2 On Wed, Apr 22, 2009 at 10:25 AM, Daniel Jacobowitz wrote: > On Mon, Apr 20, 2009 at 12:08:54PM -0700, Paul Pluzhnikov wrote: > >> 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. But if we don't have symbols, libthread_db will not work at all (the way linux libthread_db finds out whether it is compatible with the inferior: it asks GDB to lookup one of the three symbols in this patch. If GDB says there is no such symbol, then td_ta_new returns TD_NOLIBTHREAD). In fact there was a patch to add a warning if we detect stripped libpthread.so, as this appears to be a common path to non-working GDB: http://sourceware.org/ml/gdb-patches/2009-02/msg00232.html The patch didn't make it, though. > Personally, I'd rather ditch the warning for static binaries. =A0Check > the shared library list for libpthread if all available libthread_db's > have failed, and if there is one, warn then. =A0Any thoughts on that? > > Otherwise, I won't object to what you've got. =A0I am just generally > dissatisfied with hard-coding a list of symbols from the > implementation. =A0e.g. uClibc could legitimately use different names. Good point. uClibc currently uses __linuxthreads_version (and diet-libc doesn't provide libthread_db at all, AFAICT), but that certainly isn't guaranteed. OTOH, uClibc could have named its pthread library libmt.so or anything else, and we have to make some assumptions about names anyway, or just not issue warnings at all. I think warning only for dynamic case is a good compromise. It will also subsume teawater patch mentioned above. I'll send updated patch next week when I come back from vacation. Thanks, --=20 Paul Pluzhnikov