[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freebsd-hackers
Subject:    Re: Extracting symbol info out of processes at runtime
From:       Eric Jacobs <eaja () erols ! com>
Date:       2004-04-29 23:37:06
Message-ID: 20040429193706.22fd50f9.eaja () erols ! com
[Download RAW message or body]

On Thu, 29 Apr 2004 14:51:47 +0200
"P. de Boer" <pieter@thelostparadise.com> wrote:

> 
> On Thu, 2004-04-29 at 14:30, Dag-Erling Smørgrav wrote:
> > "P. de Boer" <pieter@thelostparadise.com> 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
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic