This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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: Forcing a core dump


On Thursday, October 2, 2003, at 06:59 AM, Mark Rowe wrote:
Is there a compiler flag that forces a core dump when a program terminates
unexpectedly ? I have a multi-threaded program that sometimes terminates
unexpectedly with no core file. If I can force a core file, I can run gdb
on it.

No. Feel free to catch all signals, and put a while (1) pause () in the handler, and then compile with -Dexit=myexit and define myexit to do the same thing is the arg is != 0, then all you have to do is check the return statements in main, and do -Dabort=myabort and you'll be set.


When it hangs, gdb attach it, and then see what it was doing and where...

This is beyond the scope of this list...


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