From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 29 16:38:13 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 DCD9316A4CE for ; Thu, 29 Apr 2004 16:38:13 -0700 (PDT) Received: from smtp03.mrf.mail.rcn.net (smtp03.mrf.mail.rcn.net [207.172.4.62]) by mx1.FreeBSD.org (Postfix) with ESMTP id 95EB043D45 for ; Thu, 29 Apr 2004 16:38:13 -0700 (PDT) (envelope-from eaja@erols.com) X-Info: This message was accepted for relay by smtp03.mrf.mail.rcn.net as the sender used SMTP authentication X-Trace: UmFuZG9tSVYrSO3REX152rBB/SXoqL82VkTC+UR/ZrynL001iXSKc6Z2S8TIF3lj Received: from 165.sub-166-141-30.myvzw.com ([166.141.30.165] helo=localhost) by smtp03.mrf.mail.rcn.net with asmtp (Exim 3.35 #4) id 1BJL6N-0001vx-00 for freebsd-hackers@freebsd.org; Thu, 29 Apr 2004 19:38:04 -0400 Date: Thu, 29 Apr 2004 19:37:06 -0400 From: Eric Jacobs To: freebsd-hackers@freebsd.org Message-Id: <20040429193706.22fd50f9.eaja@erols.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 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 23:38:14 -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