使用gdb的核心转储分析 [英] Core dump analysis using gdb
问题描述
我有几个关于核心转储的问题。我在Windows上有gdb,使用Cygwin。
I have a couple of questions regarding core dumps. I have gdb on Windows, using Cygwin.
-
核心转储文件的位置是什么?它是a.exe.stackdump文件吗? (这是唯一的文件生成后崩溃)我读在其他论坛,核心转储文件命名为核心。但是我没有看到任何名为core的文件。
What is the location of core dump file? Is it a.exe.stackdump file? (This is the only file that generated after crash) I read on other forums that the core dump file is named "core". But I don't see any file with name "core".
打开和理解核心转储文件的命令是什么? li>
What is the command for opening and understanding core dump file?
推荐答案
-
您需要配置Cygwin以生成核心转储包含
You need to configure Cygwin to produce core dumps by including
error_start = x:\path\to\dumper.exe
在您的 CYGWIN
环境变量中(参见这里在转储部分了解更多信息)。
error_start=x:\path\to\dumper.exe
in your CYGWIN
environment variable (see here in section "dumper" for more information). If you didn't do this, you will only get a stacktrace -- which may also help you in diagnosing the problem, though.
启动gdb如下所示:如果你没有这样做,你只会得到一个堆栈跟踪 - 这也可以帮助你诊断问题。将其附加到核心转储文件:
Start gdb as follows to attach it to a core dump file:
gdb myexecutable --core = mycorefile
现在,您可以使用常用的gdb命令打印一个stacktrace,检查变量的值,等等。
gdb myexecutable --core=mycorefile
You can now use the usual gdb commands to print a stacktrace, examine the values of variables, and so on.
这篇关于使用gdb的核心转储分析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!