[cxx-abi-dev] Re: gcc unwind ABI change for forced unwind

Cary Coutant cary at cup.hp.com
Thu May 22 18:40:05 UTC 2003


>> Cleanups resulting from local automatic objects that need destruction 
>> are
>> easy, but the problem is what to do about catch(...) blocks. Richard's
>> approach was to end such blocks with a call to the new API,
>> "_Unwind_Resume_or_Rethrow()", if the block did not already end with a
>> rethrow.
>
> Rather, a rethrow at the end of a catch(...) block uses that API 
> instead of
> the usual rethrow code.  If the block doesn't end with a rethrow, 
> nothing
> is changed.

Thanks for the correction. I thought I understood it, but now it looks 
like I missed something fundamental. So it's not to make sure that a 
rethrow happens during a forced unwind -- it's to make sure that a 
forced unwind continues rather than simply raising a new exception.

The logic for _Unwind_Resume_or_Rethrow(), then,  is to see if we're in 
a forced unwind or not. If we're not, it just calls 
_Unwind_RaiseException() like it always used to. If we are, it 
continues with the forced unwind. Why couldn't this logic simply have 
been added to _Unwind_RaiseException()? I think I know the answer: 
because the private fields in the exception object that indicate 
whether or not a forced unwind is in progress won't have been 
initialized on a first throw. Is there another reason?

-cary




More information about the cxx-abi-dev mailing list