Debugging MinGW program with gdb on Windows, not terminating at assert failure

Found out that the breakpoint can be put in the .gdbinit file with the lines:

set breakpoint pending on
b exit

This removes the need to enter yes for windows.


Just set a breakpoint on exit:

(gdb) b exit


Using recent (March 2017) msys2 with gcc 6.3 and gdb 7.12.1 you should use:

break _exit

i.e. use _exit and not exit. I expect this also to work in other cases as I expect that exit will call _exit to actually exit.