------- Comment #25 from jakub at gcc dot gnu dot org 2006-02-24 19:56 ------- Updated patches. Unfortunately, it seems even this is not enough as Java (and C++ as well, but there we aren't expecting to throw through signal frames), the personality routine does the same as uw_frame_state_for was doing, i.e. subtract one from ra. That's ok for most frames, unless they are immediately above a signal trampoline. In that case we shouldn't be subtracting one. But returning context->ra - fs->signal_frame in _Unwind_GetIP is a bad idea IMHO, _Unwind_GetIP should show some instruction pointer, context->ra - 1 may very well not be start of any instruction. For e.g. _Unwind_Backtrace we want context->ra as is, not adjusted. So, I'd say we should export a new function from libgcc_s, either something like _Unwind_SignalFrameContext (context) which will return context->signal_frame != 0, or _Unwind_GetIP alternative, _Unwind_GetAdjustedIP (context). In the first case, C++/Java personality routine would use _Unwind_GetIP (context) + (_Unwind_SignalFrameContext (context) ? 0 : -1) instead of the current _Unwind_GetIP (context) - 1, in the latter case it would use _Unwind_GetAdjustedIP (context) instead of _Unwind_GetIP (context) - 1. _Unwind_SignalFrameContext sounds more flexible to me. Richard, what do you think?
-- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26208