From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 29 07:46:23 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4C14D16A4CE for ; Thu, 29 Apr 2004 07:46:23 -0700 (PDT) Received: from fire.securenet-server.net (fire.securenet-server.net [63.247.80.82]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0517E43D41 for ; Thu, 29 Apr 2004 07:46:23 -0700 (PDT) (envelope-from eric@theeric.com) Received: from 165.sub-166-141-30.myvzw.com ([166.141.30.165] helo=localhost) by fire.securenet-server.net with asmtp (Exim 4.24) id 1BJCnk-0001EX-TW for freebsd-hackers@freebsd.org; Thu, 29 Apr 2004 10:46:17 -0400 Date: Thu, 29 Apr 2004 10:45:34 -0400 From: Eric Jacobs To: freebsd-hackers@freebsd.org Message-Id: <20040429104534.17951b8a.eric@theeric.com> In-Reply-To: <1083243107.640.13.camel@edinburgh.thedarkside.tix> References: <1083167960.653.23.camel@edinburgh.thedarkside.tix> <1083243107.640.13.camel@edinburgh.thedarkside.tix> X-Mailer: Sylpheed version 0.8.5 (GTK+ 1.2.10; i386-portbld-freebsd4.2) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - fire.securenet-server.net X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - theeric.com X-Mailman-Approved-At: Fri, 30 Apr 2004 05:21:39 -0700 Subject: Re: Extracting symbol info out of processes at runtime X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2004 14:46:23 -0000 On Thu, 29 Apr 2004 14:51:47 +0200 "P. de Boer" wrote: > > On Thu, 2004-04-29 at 14:30, Dag-Erling Smørgrav wrote: > > "P. de Boer" writes: > > > For a little private project I'm working at, I need to find the address > > > of a function which is inside a shared library of a running process, OR > > > the base address the library is running at > > > > man dlinfo > > Well, yes, dlinfo() would be very useful, if it was not for my wish to > read the link_map from another proces, using ptrace(). I've looked at > rtld-elf.c, to see what dlinfo() does: it finds the object by the given > address and then 'returns' the link_map for that object. However, I > can't find out where this info would be in the memory image of a running > process. Have a look at /proc/NNN/map (If trying to read it gives you "File too large", try it with a bigger buffer size.) The segment load address is in the leftmost column. Eric