]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r323997-r323998
authorian <ian@FreeBSD.org>
Thu, 19 Oct 2017 17:26:26 +0000 (17:26 +0000)
committerian <ian@FreeBSD.org>
Thu, 19 Oct 2017 17:26:26 +0000 (17:26 +0000)
commit2d825849d1b70ab53122b6169aa906574311ef72
treef9587328e8709c3a919f53571fea72d77df20d01
parentca418c7c739e9e4487d6defc0099fcc25335babe
MFC r323997-r323998

r323997:
Fix handling of uncaught exceptions in a std::terminate() handler on arm.

When raising an exception, the unwinder searches for a catch handler and if
none is found it should invoke std::terminate() with the uncaught exception
as the "current" exception.  Before this change, the terminate handler was
invoked with no exception as current (abi::__cxa_current_exception_type()
returned NULL), because the return value from the unwinder indicated an
internal failure in unwinding.  It turns out that was because all errors
from get_eit_entry() were translated to _URC_FAILURE.  Now the error is
returned untranslated, which allows _URC_END_OF_STACK to percolate upwards
to throw_exception() in libcxxrt.  When it sees that return status it
properly calls std::terminate() with the uncaught exception installed
as the current exception, allowing custom terminate handlers to work
with it.

r323998:
Fix the return value from _Unwind_Backtrace() on arm.

If unwinding stops due to hitting the end of the call chain, the return
value is supposed to be _URC_END_OF_STACK; other values indicate internal
errors.  The return value from get_eit_entry() is now returned without
translating it to _URC_FAILURE, so that callers can see _URC_END_OF_STACK
when it happens.
contrib/gcc/config/arm/unwind-arm.c