LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   How to generate a core dump programmatically? (https://www.linuxquestions.org/questions/programming-9/how-to-generate-a-core-dump-programmatically-656616/)

mistretzu 07-18-2008 08:53 AM

How to generate a core dump programmatically?
 
I know how to setup Linux to create core dump when a process crashes.
But it is required to be able to generate the core dump when my process crashes programmatically, so I can control where the core dump is generated and what is the name of the file. Also it would be great if I can do this without modifying any system settings.

On Windows, all these are possible, is this doable on Linux?

Thanks.

pinniped 07-18-2008 09:06 AM

Send just about any unhandled signal to force a core dump; 'SIGSEGV' is a favorite.
Within the program, you do this with 'raise' (man 3 raise)


All times are GMT -5. The time now is 07:45 PM.