This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


On Tue, Jul 19, 2005 at 07:13:17PM -0700, Brian Dessent wrote:
>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.

And, FWIW, gdb *does* do the right thing (i.e., the same thing as any
UNIX system) when the program generates a genuine SIGSEGV.  It just
doesn't do anything for cygwin-specific signals like SIGABRT.  It
also won't stop if you do something like "kill (getpid (), SIGSEGV)" since
that just sends a "cygwin signal".

cgf


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]