Using a stackdump from Cygwin executable

北城余情 提交于 2019-11-29 19:54:45

You can instruct Cygwin to start your gdb debugger just in time when an fault occurs. To achieve this, add error_start=action to the Cygwin environment variable:
export CYGWIN="$CYGWIN error_start=gdb -nw %1 %2"

Else you can have Cygwin generate a real core dump.
export CYGWIN="$CYGWIN error_start=dumper -d %1 %2"

Firstly, make sure you build with source debugging enabled (the using -g option):

gcc -g -o myfile myfile.c

Then Load the dump into gdb after the crash (or insight, or ddd)

gdb myfile core
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!