我从 x86 Linux 机器(内核 2.6.35-22,如果重要的话)上的死进程中获得了全堆核心转储,我正在尝试在 GDB 中对其进行调试。
是否有一个我可以使用的 GDB 命令,意思是“显示该进程分配的所有内存地址区域的列表?”换句话说,我能否找出可以在此转储中检查的所有可能的有效内存地址?
我问的原因是我需要搜索整个进程堆对于某个二进制字符串,并且为了使用find
命令,我需要有一个开始和结束地址。简单地从 0x00 搜索到 0xff.. 是行不通的,因为find
一旦遇到无法访问的地址就会停止:
(gdb) 查找 /w 0x10000000, 0xff000000,
0x12345678
警告:无法访问 0x105ef883 处的目标内存,正在停止
搜索。
因此,我需要获取内存中所有可读地址区域的列表,以便一次可以搜索它们。
(我需要做的原因that我需要找到内存中指向的所有结构at某个地址。)
None of show mem
, show proc
, info mem
, info proc
似乎做我需要的。
在 GDB 7.2 中:
(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.
你要info proc mappings
,除非没有时它不起作用/proc
(例如在事后调试期间)。
Try maintenance info sections
反而。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)