Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Feb 2002 23:42:32 -0600 (CST)
From:      Haryadi Gunawi <haryadi@cs.wisc.edu>
To:        freebsd-questions@freebsd.org
Subject:   /proc/pid/map (freeBSD vs Linux)
Message-ID:  <Pine.GSO.4.21.0202202326210.16631-100000@nova11.cs.wisc.edu>

next in thread | raw e-mail | index | archive | help

> From:      Roman Neuhauser <neuhauser@mobil.cz>
> Subject:   Re: /proc/pid/map (freeBSD vs Linux)
> Message-ID:  <20020220142036.GL418@roman.mobil.cz>

>    I don't know if this is what you're looking for, but ldd(1) might
>    help(?).

-- 

Thanks for the answer,
ldd is not really what I'm looking for.

Here is my project in detail.
- I have a PID (from getpid)
- Then I want to look what program has that PID (by looking at the
/proc/pid/map)
- next I must know what libraries are utilized, and their text segments
(where the code are allocated)

So looking at the /proc/pid/map (just the text segments,
identified by 'r-x' mode):

In FreeBSD:
0x8048000 0x8049000 1 0 0xc8776d20 r-x 2 0 0x0 COW NC vnode
0x28049000 0x2805a000 12 0 0xc03f9f80 r-x 73 34 0x0 COW NC vnode
0x28065000 0x280e5000 57 0 0xc03fad60 r-x 73 34 0x0 COW NC vnode

In Linux:
8048000-08049000 r-xp 00000000 03:08 22408      /rdata/src/test/loop/a.out
40000000-40016000 r-xp 00000000 03:08 44178      /lib/ld-2.1.92.so
40022000-4013d000 r-xp 00000000 03:08 44185      /lib/libc-2.1.92.so

I know the first one is the executable itself, the 2nd one should be the
dynamic linker, and the third one is the C library. The first and 2nd
column are the starting and ending text/code segment.

Now the problem is: 
  I don't know what is the executable name, and the
  libraries utilized from /proc/pid/map in FreeBSD. 
  In Linux I can easily get them from the last column.
  Where can I get those names in FreeBSD?

I assume the numbers in the third column (1, 12, 57) mean something, but
I don't know what they are.


Thank you very much,
appreciate your time,
hg


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.21.0202202326210.16631-100000>