From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6329 invoked by alias); 7 Aug 2003 20:31:34 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 6320 invoked from network); 7 Aug 2003 20:31:32 -0000 Received: from unknown (HELO mms2.broadcom.com) (63.70.210.59) by sources.redhat.com with SMTP; 7 Aug 2003 20:31:32 -0000 Received: from 63.70.210.1 by mms2.broadcom.com with ESMTP (Broadcom SMTP Relay (MMS v5.5.2)); Thu, 07 Aug 2003 13:27:27 -0700 Received: from mail-sj1-5.sj.broadcom.com (mail-sj1-5.sj.broadcom.com [10.16.128.236]) by mon-irva-11.broadcom.com (8.9.1/8.9.1) with ESMTP id NAA09603; Thu, 7 Aug 2003 13:30:31 -0700 (PDT) Received: from ldt-sj3-010.sj.broadcom.com (ldt-sj3-010 [10.21.64.10]) by mail-sj1-5.sj.broadcom.com (8.12.9/8.12.9/SSF) with ESMTP id h77KUuov006066; Thu, 7 Aug 2003 13:30:56 -0700 (PDT) Received: (from cgd@localhost) by ldt-sj3-010.sj.broadcom.com ( 8.11.6/8.9.3) id h77KUuN20730; Thu, 7 Aug 2003 13:30:56 -0700 X-Authentication-Warning: ldt-sj3-010.sj.broadcom.com: cgd set sender to cgd@broadcom.com using -f To: ac131313@redhat.com cc: "Elena Zannoni" , gdb-patches@sources.redhat.com, "Michael Elizabeth Chastain" Subject: Re: [rfa:threads] Report when using libthread_db References: <3F3004F7.6090003@redhat.com> <3F32AF3A.1080106@redhat.com> From: cgd@broadcom.com Date: Thu, 07 Aug 2003 20:31:00 -0000 In-Reply-To: Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 X-WSS-ID: 132C69A5117034-01-01 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2003-08/txt/msg00108.txt.bz2 At Thu, 7 Aug 2003 19:58:06 +0000 (UTC), "Andrew Cagney" wrote: > Anyone know how to get a version number from libthread_db, or it's > absolute path? looks like there are two ways one can do this: dlinfo() on Solaris (and other systems that have it -- but it doesn't appear common). dladdr() on systems that have it and this one is more widespread (incl solaris, linux at least with -D_GNU_SOURCE, and it looks like NetBSD has it as well). Use dladdr like: { int rv; Dl_info dli; rv = dladdr(cosine, &dli); printf ("rv = %d\n", rv); printf ("name = %s\n", dli.dli_fname); } (that example should drop into example provided in the RH 7.3 x86 'dlopen' manual page. I'm not sure the original source of that manual page, though... 8-) (works for dlsym'd addresses, but doesn't necessarily work as one would naively expect for symbols needed directly by the main program, of course...) cgd