Hi Larry,
cmd = aprintf("gdb -batch -ex backtrace
'%s/bk' %u 1>&%d 2>&%d",
bin, getpid(), fileno(f), fileno(f));
system(cmd);
I also came up with this, probably on an SGI Iris Indigo, and got it
added to the Unix Programming FAQ. :-)
6.5 How can I generate a stack dump from within a running program?
http://www.faqs.org/faqs/unix-faq/programmer/faq/
It works surprisingly often, i.e. the process is healthy enough to run
system(3).
--
Cheers, Ralph.