This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Forcing a core dump
- From: Mike Stump <mrs at apple dot com>
- To: Mark Rowe <mark at markrowe dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 2 Oct 2003 12:13:11 -0700
- Subject: 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...