Core dump analysis using gdb
I have a couple of questions regarding core dumps. I have gdb on Windows, using Cygwin.
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".
What is the command for opening and understand开发者_开发百科ing core dump file?
You need to configure Cygwin to produce core dumps by including
error_start=x:\path\to\dumper.exe
in yourCYGWIN
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.Start gdb as follows to attach it to a core dump file:
gdb myexecutable --core=mycorefile
You can now use the usual gdb commands to print a stacktrace, examine the values of variables, and so on.
- Yes, cygwin creates
a.exe.stackdump
files by default. You need to configure it to createcore
s as well (Martin's answer covers that). - A simple tutorial on core dump debugging can be found here
精彩评论