GDB:列出所有映射内存区域的过程中坠毁 [英] GDB: Listing all mapped memory regions for a crashed process
问题描述
我接到了一个死亡过程,全方位堆核心转储一个x86 Linux机器(内核2.6.35-22,如果它的事项),其中我试图在GDB调试上。
I've got a full-heap core dump from a dead process on an x86 Linux machine (kernel 2.6.35-22 if it matters), which I'm attempting to debug in GDB.
是否有一个GDB命令我可以使用,意思是让我知道该进程分配的内存地址区域的列表?换句话说,我可以找出所有可能的有效内存地址,我可以在这个破检查?
Is there a GDB command I can use that means "show me a list of all the memory address regions allocated by this process?" In other words, can I figure out what all the possible valid memory addresses are that I can examine in this dump?
我想问的原因是我需要通过的整个进程堆的搜索一定的二进制串,而且为了使用找到
命令,我需要有一个开始和结束地址。只需从0x00到0xFF的搜索..不起作用,因为找到
只要它遇到一个地址,可以不中止访问:
The reason I ask is that I need to search across the entire process heap for a certain binary string, and in order to use the find
command, I need to have a start and end address. Simply searching from 0x00 to 0xff.. doesn't work because find
halts as soon as it encounters an address it can't access:
(GDB)发现/ W 0x10000000处,0xff000000,
为0x12345678
(gdb) find /w 0x10000000, 0xff000000, 0x12345678
警告:无法在0x105ef883访问目标内存,停止
搜索
warning: Unable to access target memory at 0x105ef883, halting search.
所以,我需要得到所有在内存中的读取的地址区域的列表,所以我可以同时搜索其中之一。
So I need to get a list of all the readable address regions in memory so I can search them one at a time.
(的原因,我需要做的是的是我需要找到所有在内存的某个地址的结构指向的)
(The reason I need to do that is I need to find all the structs in memory that point at a certain address.)
中没有显示纪念品
,显示PROC
,信息纪念品
,信息PROC
似乎做什么,我需要。
None of show mem
, show proc
, info mem
, info proc
seem to do what I need.
推荐答案
在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.
您想信息PROC映射
,除非没有的/ proc
(如它不工作在POS验调试)。
You want info proc mappings
, except it doesn't work when there is no /proc
(such as during pos-mortem debugging).
尝试维护信息部分
代替。
这篇关于GDB:列出所有映射内存区域的过程中坠毁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!