Linux程序调试--gdb中使用命令收集core文件信息

阅读更多

以下是一个进行core文件解析的命令文件

#
# core文件解析用的gdb command 文件

# Usage: gdb -x gdb.txt 进程名 core文件或者PID | tee 保存信息用的文件名
#
set height 0
set width 0
#所有进程信息
# 程序指令计数器位置的反汇编
shell echo ""
shell echo ">>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<"
shell echo ">>>>>>>>> program counter disassemble <<<<<<<<<"
shell echo ">>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<"
shell echo ""
x/10i $pc
#所有寄存器
shell echo ""
shell echo ">>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<"
shell echo ">>>>>>>>>>>> all register display <<<<<<<<<<<<<"
shell echo ">>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<"
shell echo ""
info register all
# 程序指令计数器周围位置的反汇编
shell echo ""
shell echo ">>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<"
shell echo ">>>>> around program counter disassemble <<<<<<"
shell echo ">>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<"
shell echo ""
x/20i $pc-0x10
#所有线程
shell echo ""
shell echo ">>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<"
shell echo ">>>>>>>>>>>>>>>>> info thread <<<<<<<<<<<<<<<<<"
shell echo ">>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<"
shell echo ""
info thread
#所有线程执行的栈调用全追踪
shell echo ""
shell echo ">>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<"
shell echo ">>>>>>> all thread exec backtrace full <<<<<<<<"
shell echo ">>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<"
shell echo ""
thread apply all bt full
quit

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