Forcing C program to core dump
Viktor Vasilev
viktor.vasilev at stud.tu-darmstadt.de
Wed Dec 6 11:52:04 PST 2006
On Wednesday 06 December 2006 20:02 Garrett Cooper wrote:
> Hello,
> This may be obvious to some, but after some Googling (apparently
> with the wrong search terms, perhaps) and reading the gcc/gdb manpages,
> I can't seem to find out how to get a program to produce core dumps.
> So I was wondering, is there some simple means to produce core dumps
> or a set of conditions that I need to adhere to in order to get the OS
> to core dump the progrdam???
Some signals default action is to cause the program to dump core,
when they're delivered. You can see the list in the signal(3) man
page. libc also provides the abort(3) function, which does what
you want. The code is here:
/usr/src/lib/libc/stdlib/abort.c
Cheers,
Vik
--
PGP Key: 0xE09DC8D8/6799 4011 EBDE 6412 05A1 090C DBDF 5887 E09D C8D8
Signed/encrypted mail welcome!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20061206/bdb21a01/attachment.pgp
More information about the freebsd-hackers
mailing list