From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19626 invoked by alias); 20 Apr 2009 19:09:06 -0000 Received: (qmail 19612 invoked by uid 22791); 20 Apr 2009 19:09:05 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,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; Mon, 20 Apr 2009 19:08:59 +0000 Received: from spaceape11.eur.corp.google.com (spaceape11.eur.corp.google.com [172.28.16.145]) by smtp-out.google.com with ESMTP id n3KJ8uei027983 for ; Mon, 20 Apr 2009 12:08:57 -0700 Received: from qyk10 (qyk10.prod.google.com [10.241.83.138]) by spaceape11.eur.corp.google.com with ESMTP id n3KJ8opL002058 for ; Mon, 20 Apr 2009 12:08:55 -0700 Received: by qyk10 with SMTP id 10so3939302qyk.13 for ; Mon, 20 Apr 2009 12:08:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.84.82 with SMTP id i18mr769684qcl.90.1240254534315; Mon, 20 Apr 2009 12:08:54 -0700 (PDT) In-Reply-To: <20090420180352.GA14206@caradoc.them.org> References: <20090406203920.CCD6F19C4EC@localhost> <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> Date: Mon, 20 Apr 2009 19:09:00 -0000 Message-ID: <8ac60eac0904201208m95d4585k2b09f6b6fe5edb40@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/msg00535.txt.bz2 On Mon, Apr 20, 2009 at 11:03 AM, Daniel Jacobowitz wrote: > I don't see why you need the symbol list for this; shouldn't we do the > search at the same time we'd previously have pushed libthread_db? 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. 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. > =A0We > went through a lot of pain to get the timing right for both dynamic > and static binaries. Yes, it caused me a bit of trouble as well :-( But (a variant of) the current patch has been tested in all combinations :-) --=20 Paul Pluzhnikov