`

Linux系统GDB调试-3

 
阅读更多

3、程序core掉调试
(1)设定core文件和文件大小为无限大
ulimit -c unlimited
ulimit unlimited
(2)用gdb查看core文件
gdb ./test test.core
(3)bt查看发生段错误segment error的地方

#include <stdio.h>
int sum()
{
 int i = 100;
 int a = i/0;
}

int main()
{

 sum();
 return 0;
}


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics