Debugging a debugger - gdb crash on Windows XP

If you’re one of the crazy guys building gdb for Windows using the 4.6.1 version of the mingw gcc compiler, here’s something to watch out for. gdb will crash on any error (even a mistyped command), but only on Windows XP. Turns out that gdb uses a setjmp/longjmp based error handling mechanism (see gdb/exceptions.c), and any error causes gdb to execute a longjmp. In Windows land, longjmp is implemented in msvcrt.