gdb使用整理

gdb使用整理

coredump 配置使用

kernel
[Config Kernel settings] -> [General setup] -> [Configure standard kernel features(except users)] -> [Enable ELF core dumps],打开该选项编译后在image目录下多一个 vmlinuz.img.align文件

ulimit -c unlimited 设置coredump文件大小为unlimited
ulimit -s unlimited(option)设置线程栈大小
echo “/usr/conf/core_%e_%p_%t” > /proc/sys/kernel/core_pattern 设置core文件生成目录,一般可设置为SD卡目录

gdb 查看内存内容

参考: https://blog.csdn.net/chun_1959/article/details/45867167

gdb coredump 原理

参考: https://blog.csdn.net/u014403008/article/details/54666438

GDB: Listing all mapped memory regions for a crashed process

(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.

gdb dump memory region

dump binary memory result.bin 0x200000000 0x20000c350

你可能感兴趣的:(Linux,tools)