Linux

通過特定地址從 /proc/id/maps 提供行的實用程序

  • May 11, 2015

是否有一個實用程序可以/proc/id/maps在給定此過程的特定地址時為我提供特定的行?

例如,當0x7fb4a84f6008它返回時:

7fb4a84f6000-7fb4a84fd000 r-xp 00000000 00:48 20132    /lib64/libnss_compat-2.21.so

也許pmap做你想要的:

$ sudo pmap -Ab75bf022 26746
26746:   dhclient -1 -v -pf /run/dhclient.eth5.pid -lf /var/lib/dhcp/dhclient.eth5.leases eth5
b75bf000      4K rw--- ld-2.19.so
total        4K

或者使用地址範圍和完整路徑:

$ sudo pmap -p -Ab75bf022,b77bf022 26746
26746:   dhclient -1 -v -pf /run/dhclient.eth5.pid -lf /var/lib/dhcp/dhclient.eth5.leases eth5
b75bf000      4K rw--- /lib/i386-linux-gnu/ld-2.19.so
b75c0000   1732K r-x-- /sbin/dhclient
b7771000      4K r---- /sbin/dhclient
b7772000     12K rw--- /sbin/dhclient
b7775000     44K rw---   [ anon ]
total     1796K

引用自:https://unix.stackexchange.com/questions/202719