debug command

根据debug版本生成符号表  objcopy --only-keep-debug Debug symbol.dbg objcopy --add-gnu-debuglinkb.运行"objcopy --only-keep-debug foo foo.dbg"创建一个包含调试信息的文件 c.运行"objcopy --strip-debug foo"创建一个去掉调试信息的(  strip的)可执行文件 d.运行"objcopy --add-gnu-debuglink=foo.dbg foo",为strip的文件添加调试信息链接)gdb 用符号表调式release版本 gdb -q --symbol=symbol.dbg -exec=release断点 b fun()  b file:linegdb 附加到进程  gdb 程序名 --pid=gdb exec.file core.filegdb xx.core  then file.exec修改/proc/sys/kernel/core_user_pid文件。可以叫pid作为扩展名,生成的core的格式位core.xxx,xxx位pid修改/proc/sys/kernel/core_pattern可以控制core文件的保存位置和格式,如将所有的core文件保存到/corefile目录下,文件的格式位core-命令名-pid-时间戳. echo “//corefile/core_%e_%p_%t” > /proc/sys/kernel/core_patterngbd -args[options]

你可能感兴趣的:(debug command)