从查看proc(5)文件系统开始.man是你的朋友.
/proc/[number]/maps 包含当前映射的内存区域及其访问权限的文件
在gdb中,你可以使用
$ gdb -q
(gdb) help info proc
Show /proc process information about any running process.
Specify any process id, or use the program being debugged by default.
Specify any of the following keywords for detailed info:
mappings -- list of mapped memory regions.
stat -- list a bunch of random process info.
status -- list a different bunch of random process info.
all -- list all available /proc info.
Run Code Online (Sandbox Code Playgroud)
看看info proc mappings,除了没有/ proc时(例如在正面调试期间)它不起作用.