[cxx-abi-dev] __cxa_current_exception_type

Jason Merrill jason at redhat.com
Sat Nov 17 10:58:31 UTC 2001


>>>>> "Martin" == Martin von Loewis <loewis at informatik.hu-berlin.de> writes:

>> It seems reasonable to me to add this even now, since it's a pure
>> extension; people can add it to their runtimes at their leisure.  Thoughts?

> Wouldn't it be then useful to give access to the exception object
> also?

I don't think so; I think try/catch are a better way to get a handle on the
exception object.  When I started writing a verbose terminate handler,
originally I was trying to hand the object pointer from the EH structures
off to the dynamic cast machinery by hand to get an exception*, until I
realized that I could just write

  try { throw; }
  catch (exception& e) { ... }
  catch (...) { }

which is both simpler and portable.

Jason



More information about the cxx-abi-dev mailing list