From owner-freebsd-hackers Fri Jun 8 10:16:26 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by hub.freebsd.org (Postfix) with ESMTP id 33E7237B405 for ; Fri, 8 Jun 2001 10:16:24 -0700 (PDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.11.3/8.11.3) id f58HGGv26529; Fri, 8 Jun 2001 12:16:16 -0500 (CDT) (envelope-from dan) Date: Fri, 8 Jun 2001 12:16:16 -0500 From: Dan Nelson To: Kevin Day Cc: hackers@FreeBSD.ORG Subject: Re: Access to symbol table(including dynamics) at runtime Message-ID: <20010608121616.A23647@dan.emsphone.com> References: <200106081709.MAA42527@temphost.dragondata.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200106081709.MAA42527@temphost.dragondata.com> User-Agent: Mutt/1.3.19i X-OS: FreeBSD 5.0-CURRENT Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In the last episode (Jun 08), Kevin Day said: > Is there a simple way that I can lookup a symbol name(by address) > during runtime? > > I know I can exec nm, look up for the address I need, and get local > symbols, but it would be really nice if I could get addresses of > functions in dynamic libraries as well. I know I could use ldd to get > offsets of each .so and calculate from there, but I'm starting to > think I'm reproducing work that was done somewhere else. > > If someone could point me at a man page to something that can do what > I need, tell me of a library that does something similar, or tell me > why this can't be done, i'd be very thankful. :) Would dladdr() do what you want? -- Dan Nelson dnelson@emsphone.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message