The problem with doing this is that the program MIGHT be at an unstable state in terms of memory allocation. Linux (newer ones at least) also optionally have the pstack program, so it's not unique per se.
/ David Hedbor
Previous text:
2003-10-02 17:54: Subject: Re: Some tasks from the conference
In the last episode (Oct 02), David Hedbor @ Pike developers forum said:
o Dump pike backtraces on SIGSEGV.
How about dumping C backtraces also, when possible (probably limited to Linux?). I have code for this and it would be, especially combined with pike backtraces, quite useful in case you get sporadic crashes and can't always run with gdb. Example output:
Solaris comes with a "pstack" program you can shell out and call on yourself, and there's a pstack port in the FreeBSD ports tree. Make sure that if you code it yourself, you are able to print stack traces for all threads.
For systems without pstack, you can always shell out and run a gdb/dbx/ladebug script to dump backtraces.
-- Dan Nelson dnelson@allantgroup.com
/ Brevbäraren