From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 931 invoked by alias); 23 Apr 2009 06:21:34 -0000 Received: (qmail 923 invoked by uid 22791); 23 Apr 2009 06:21:32 -0000 X-SWARE-Spam-Status: No, hits=-1.0 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 ti-out-0910.google.com (HELO ti-out-0910.google.com) (209.85.142.185) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 23 Apr 2009 06:21:27 +0000 Received: by ti-out-0910.google.com with SMTP id a1so52100tib.12 for ; Wed, 22 Apr 2009 23:21:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.110.3.15 with SMTP id 15mr53415tic.43.1240467684799; Wed, 22 Apr 2009 23:21:24 -0700 (PDT) In-Reply-To: <8ac60eac0904221810x24763ecaj4a888927b766e7f7@mail.gmail.com> 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> <8ac60eac0904221810x24763ecaj4a888927b766e7f7@mail.gmail.com> Date: Thu, 23 Apr 2009 06:21:00 -0000 Message-ID: Subject: Re: [patch][rfc] Allow GDB to search for the right libthread_db.so.1 From: Hui Zhu To: Paul Pluzhnikov Cc: 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-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/msg00636.txt.bz2 On Thu, Apr 23, 2009 at 09:10, Paul Pluzhnikov wro= te: > On Wed, Apr 22, 2009 at 10:25 AM, Daniel Jacobowitz wrot= e: >> 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. Yes, maybe we can give user some warning and suggests in gdb when they have trouble with multi-thread debug. > >> 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. > About your patch, I think let user choice load which libthread_db is very cool idea. Why not let they set which file they want to load directly? For example: set libthread-db /xxx_dir/libxxx Let they choice, why not let they choice everything? :) Thanks, Hui