Mac OS X 下如何使用类似 Linux 下的 /proc/pid/maps 功能

本文转载至:http://stackoverflow.com/questions/8058005/mac-os-x-equivalent-of-virtualquery-or-proc-pid-maps

一言以概之,使用 vmmap (不过格式和 linux 下有些区别)

操作示例如下:

$ sudo vmmap 66
Process: warmd [66]
Path: /usr/libexec/warmd
Load Address: 0x10f95f000
Identifier: warmd
Version: ???
Code Type: X86-64
Parent Process: launchd [1]

Date/Time: 2016-12-31 10:25:56.814 +0800
Launch Time: 2016-12-31 08:02:26.417 +0800
OS Version: Mac OS X 10.11.6 (15G31)
Report Version: 7
Analysis Tool: /usr/bin/vmmap
----

Virtual Memory Map of process 66 (warmd)
Output report format: 2.4 -- 64-bit process
VM page size: 4096 bytes

==== Non-writable regions for process 66
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
__TEXT 000000010f95f000-000000010f978000 [ 100K] r-x/rwx SM=COW /usr/libexec/warmd
__LINKEDIT 000000010f97a000-000000010f981000 [ 28K] r--/rwx SM=COW /usr/libexec/warmd

你可能感兴趣的:(MacOSX)