1 编译打开gdb的开关即加入-g选项 2 设置core文件大小,ulimit -c unlimited 3 调试 加载可执行文件: gdb 可执行文件 加载core 文件: core-file core file 查看堆: bt