我怎么能看到处理后的堆栈跟踪被杀害? [英] how can i see the stack trace after the process is killed?

查看:114
本文介绍了我怎么能看到处理后的堆栈跟踪被杀害?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用gdb的命令附加调试proceess
但这一进程崩溃(SIGKILL)后,我无法看到的堆栈跟踪(在GDBBT命令):
(GDB)BT
没有堆栈。

i am using gdb command "attach" to debug a proceess but after the process crash (sigkill) i can not see the stack trace ("bt" command in gdb) : (gdb) bt No stack.

我怎么能看到堆栈跟踪的过程中被杀死之后?

how can i see the stack trace after the process is killed?

推荐答案

设置你的shell通过向核心转储确认的ulimit -c 不显示的核心尺寸0.如果它说0然后运行的ulimit -c无限。接下来,重新运行程序,直到它崩溃转储和核心然后调用:

Set your shell to dump core by making sure ulimit -c doesn't show a core size of 0. If it does say 0 then run ulimit -c unlimited. Next, re-run your program until it crashes and dumps core then call:

GDB /路径/要/可执行/路径/要/芯键,键入 BT 来获取堆栈跟踪

gdb /path/to/executable /path/to/core and type bt to get the stack trace.

此外,你会想与调试开启信息编译您的可执行文件。如果您使用 GCC 那么我会建议你使用 -ggdb3 来做到这一点。

Also, you'll want to compile your executable with debugging info turned on. If you're using gcc then I would suggest you use -ggdb3 to do this.

这篇关于我怎么能看到处理后的堆栈跟踪被杀害?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆