3 ms·
What's a good way for a program to trigger its own coredump? I had the issue on Linux and QNX embedded systems that I was unable to live-debug, and I wanted to
by AceJohnny2 10y ago
What's a good way for a program to trigger its own coredump? I had the issue on Linux and QNX embedded systems that I was unable to live-debug, and I wanted to be able to retrieve a coredump at various stages of execution. Unfortunately, all I found were CLI utilities that just called GDB, which wasn't available on my target.
I never felt confident to implement the feature directly :\
- icebraining 10y agoIf you can change the code, you can simply fork() and then abort() on the child. If you attach that as an handler to SIGUSR1/2, you can have core dumps on demand.
- AceJohnny2 10y agoNice! Thanks!