From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22047 invoked by alias); 20 Apr 2009 13:18:06 -0000 Received: (qmail 21854 invoked by uid 22791); 20 Apr 2009 13:18:01 -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; Mon, 20 Apr 2009 13:17:56 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id D622710A2C; Mon, 20 Apr 2009 13:17:53 +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 85D0A10A05; Mon, 20 Apr 2009 13:17:53 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1LvtNf-0007ED-UD; Mon, 20 Apr 2009 09:17:52 -0400 Date: Mon, 20 Apr 2009 13:18:00 -0000 From: Daniel Jacobowitz To: Paul Pluzhnikov Cc: tromey@redhat.com, Thiago Jung Bauermann , gdb-patches ml Subject: Re: [patch][rfc] Allow GDB to search for the right libthread_db.so.1 Message-ID: <20090420131751.GA25075@caradoc.them.org> Mail-Followup-To: Paul Pluzhnikov , tromey@redhat.com, Thiago Jung Bauermann , gdb-patches ml References: <20090406203920.CCD6F19C4EC@localhost> <1239225742.8871.145.camel@localhost.localdomain> <8ac60eac0904101205h76d8377cv843db8177e74f8af@mail.gmail.com> <8ac60eac0904171213p4c075224x5f5c3661d240f383@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8ac60eac0904171213p4c075224x5f5c3661d240f383@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/msg00508.txt.bz2 I have just a few minor comments on this. Overall, I am heartily in favor of the idea - I have carried a less elegant version of this feature in the Debian GDB packages for two years or so. On Fri, Apr 17, 2009 at 12:13:08PM -0700, Paul Pluzhnikov wrote: > +#ifndef LIBTHREAD_DB_SO > +#define LIBTHREAD_DB_SO "libthread_db.so.1" > +#endif > + > +#ifndef LIBTHREAD_DB_SEARCH_PATH > +#define LIBTHREAD_DB_SEARCH_PATH "" > +#endif Do we intend to let anything override these? Otherwise IMHO the ifndef just confuses the issue. > +static int > +try_thread_db_load_1(void *handle) Space before paren :-) > + if (info_verbose && strchr(library, '/') == NULL) Oh, here too. > + msym = lookup_minimal_symbol ("nptl_version", NULL, NULL); > + if (!msym) > + msym = lookup_minimal_symbol ("__linuxthreads_version", NULL, NULL); > + > + /* Some really old libpthread versions do not have either of the above. */ > + if (!msym) > + msym = lookup_minimal_symbol ("__pthread_threads_events", NULL, NULL); > + > + if (!msym) > + /* No threads yet */ > + return 0; Why is this symbol lookup necessary? Is it accomplishing the same thing that searching for a shared library matching "libpthread[-.]" would? Also see libpthread_solib_p, which uses basically that method. > + libthread_db_search_path = xstrdup(LIBTHREAD_DB_SEARCH_PATH); Space there too :-) -- Daniel Jacobowitz CodeSourcery