RE: [GD-Linux] signals and exceptions
Brought to you by:
vexxed72
From: Ryan C. G. <ic...@cl...> - 2001-11-15 01:37:14
|
> Thanks for the pointer. I'll keep it in mind though at the moment I'll stick > with our setjmp/longjmp solution for debugging as it outputs much more data > than a normal backtrace provides. Still annoying that exceptions and signals > don't work together - especially since this is so elegantly done on Windows. I've been tickering with throwing from a signal handler, and have decided that not only can it not be done, it probably shouldn't be done. glibc's throw_helper() function (where throws end up) fires SIGABRT if you try to throw inside a SIGSEGV handler. I presume they are trying to be helpful, but then again, I'm not sure that signals run in the same context (for lack of a better term) on all architectures; that is, a "backtrace" might be nonexistant on some platforms while in the signal handler. It's just a fact of life: there is not going to be a clean and portable way to do this. On Intel linux, I wonder if you could just work back from %%ebp from a signal handler in any sort of meaningful way? Did I mention there's no clean, portable way to do this? :) --ryan. |