[cxx-abi-dev] ABI modification for exception propagation
David Vandevoorde
daveed at edg.com
Tue May 27 02:15:01 UTC 2008
On May 26, 2008, at 9:26 PM, Mark Mitchell wrote:
> Sebastian Redl wrote:
>> Mark Mitchell wrote:
>>> Ideally, it should be possible to freely mix old and new object
>>> files in a single application. It should be possible to throw an
>>> exception in an old file and catch it in a new one, and vice versa.
>> Hmm, I think that's not possible. Definitely not in the separation
>> model.
>
> If true, that's very unfortunate. C++ has gotten a somewhat well-
> deserved black eye by not maintaining binary compatibility over
> time. If you've needed about long-term binary compatibility, C has
> been a better choice for a long time. The C++ ABI was designed in
> part to put an end to that problem. I would hope that we could
> extend the ABI in a way that would permit old code to continue to
> work, without
>
> Is the issue that current_exception may need additional information
> in order to locate the copy constructor for the thrown object. Is
> that the issue?
Note that it doesn't have to copy the thrown object: It can
essentially return a smartptr<__cxa_exception> (which is what
std::exception_ptr would be) for the top exception. The constructor
for this smart pointer must behave a bit like __cxa_rethrow() in that
it must avoid having __cxa_end_catch destroy the exception. Instead,
that destruction must now be handled by the destructor of
smartptr<__cxa_exception> (when the reference count goes to zero).
Daveed
More information about the cxx-abi-dev
mailing list