gdb on cygwin and debugging assert() or program segmentation faults

Brian Dessent brian@dessent.net
Wed Jul 20 02:09:00 GMT 2005


Kris Thielemans wrote:

> I need to debug a C++ program that throws up an assert(). On Linux, I'm used to
> be able to run the program in gdb, and when the assert happens, the program
> stops (in the assert function) and I can do a back trace (e.g. info stack).
> On cygwin on the other hand, I just get the assert message, and then gdb
> says "Program exited normally". No backtrace possible.

Set the error_start parameter of the CYGWIN variable to gdb and then run
the program, and you should gdb launched and attached to the process
when it encounters a SEGV or abort().  See the users manual section
about $CYGWIN.

Brian



More information about the Gdb mailing list