backtrace in exception handler



I've got a Glib->install_exception_handler to catch main loop errors and
I'd like to get a backtrace for them too.

By the time the exception handler runs it's of course too late, the
stack has been unwound.  I was thinking of a global SIG{__DIE__} handler
which saves away a Devel::StackTrace to be shown if the exception
handler is reached, or not if it's an "expected" error trapped by an
eval lower down (one of the GErrors throws say).

Making a Devel::StackTrace on every die could be a bit of a slowdown if
die is being abused for flow control.  I suppose it would be only an
option (a runtime selectable one).  Is there a better way?



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]