From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10260 invoked by alias); 30 Apr 2009 19:11:49 -0000 Received: (qmail 10248 invoked by uid 22791); 30 Apr 2009 19:11:49 -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.33.17) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 30 Apr 2009 19:11:43 +0000 Received: from zps35.corp.google.com (zps35.corp.google.com [172.25.146.35]) by smtp-out.google.com with ESMTP id n3UJBduk006685 for ; Thu, 30 Apr 2009 20:11:39 +0100 Received: from qw-out-2122.google.com (qwd5.prod.google.com [10.241.193.197]) by zps35.corp.google.com with ESMTP id n3UJBbFO020913 for ; Thu, 30 Apr 2009 12:11:37 -0700 Received: by qw-out-2122.google.com with SMTP id 5so1402211qwd.39 for ; Thu, 30 Apr 2009 12:11:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.70.139 with SMTP id d11mr1709620qcj.51.1241118696992; Thu, 30 Apr 2009 12:11:36 -0700 (PDT) In-Reply-To: <20090430185551.GB10734@adacore.com> References: <8ac60eac0904201019g7ba8056bx5e84e6bfdf5935d8@mail.gmail.com> <8ac60eac0904201208m95d4585k2b09f6b6fe5edb40@mail.gmail.com> <20090422172517.GA17235@caradoc.them.org> <8ac60eac0904221810x24763ecaj4a888927b766e7f7@mail.gmail.com> <8ac60eac0904230001w1afd9179wcb76e1cfd7f3f386@mail.gmail.com> <8ac60eac0904291330m78b43c47p1cc9b8379e31e923@mail.gmail.com> <20090430185551.GB10734@adacore.com> Date: Thu, 30 Apr 2009 19:11:00 -0000 Message-ID: <8ac60eac0904301211x245c8b7cp546042d832eb1fe@mail.gmail.com> Subject: Re: [patch][rfc] Allow GDB to search for the right libthread_db.so.1 From: Paul Pluzhnikov To: Joel Brobecker Cc: Hui Zhu , 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/msg00820.txt.bz2 On Thu, Apr 30, 2009 at 11:55 AM, Joel Brobecker wr= ote: >> 1. If libthread_db_search_path is set, use it *before* trying to load >> =A0 =A0libthread_db from the same directory where libpthread was loaded = in the >> =A0 =A0inferior. > > From my naive perspective (never really had a need for this feature), > it seems better to check the path before checking the path that was > used by the inferior. =A0Otherwise, if the local host has a library > at the same location but that's different from the library used > by the inferior, we wouldn't be able to force the debugger to use > a different library, would we? Assume inferior is using remote:/a/b/c/libpthread.so.0. If host has local:/a/b/c/libthread_db.so.0 which is incompatible with remote:/a/b/c/libpthread.so.0, then try_thread_db_load("/a/b/c/libthread_db.so.0") will fail, and GDB will proceed to try other paths in libthread_db_search_path. But I see your point: if local:/a/b/c/libthread_db.so.0 "agrees" to work with the inferior (td_ta_new returns TD_OK), yet is the wrong one to use for some reason, there is no way for the user to force GDB to use an alternate libthread_db. I'll invert the order of search, get rid of symbol lookup, and send an updated patch shortly. Thanks, --=20 Paul Pluzhnikov