Using a stackdump from Cygwin executable
20,062
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"
Related videos on Youtube
Author by
Gerhard
C & C# Ruby R Embedded & PC PowerPc & AVR
Updated on February 21, 2020Comments
-
Gerhard over 4 years
So I wrote buggy code that occasionally crash ... and creates a stackdump file.
Using addr2line I can figure out how the program got to the crash point by decoding the addresses on by one. Is there an alternative tool that can ease the debug using stack dumps? Is there a way to to load this information in Insight/Gdb?
-
thoni56 over 8 yearsAnd run
gdb path/to/the/binary path/to/the/core
to debug it. Thanks to stackoverflow.com/a/5115653/204658. -
CMCDragonkai over 7 yearsWith this option
error_start=gdb -nw %1 %2
enabled, I have gdb running, however quitting gdb just results it in starting again, how I quit it completely? -
CMCDragonkai over 7 yearsI had to go outside and launch process explorer and kill the entire process tree in Windows.
-
Anonymous1847 almost 4 yearsgdb says that it does not recognize the file (with suffix ".stackdump") as a core dump.
-
Anonymous1847 almost 4 years@CMCDragonkai For future reference you can just type "kill" in gdb to kill the debugged process and then "quit" to quit gdb as well.