This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix breakage of ARM EABI EH unwinding code.
- From: Richard Earnshaw <Richard dot Earnshaw at buzzard dot freeserve dot co dot uk>
- To: gcc-patches at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
- Cc: paul at codesourcery dot com, jason at redhat dot com
- Date: Wed, 23 May 2007 21:58:35 +0100
- Subject: Fix breakage of ARM EABI EH unwinding code.
The C++ libraries for arm-eabi port have been unbuildable since Jason
checked in his foreign exceptions unwinding patch on May 7th. This
patch fixes the problems by adding the appropriate functionality to the
__cxa_type_match routine (the ARM unwinder model currently doesn't
support forced unwinding -- an ongoing issue for the ABI).
OK?
2007-05-23 Richard Earnshaw <rearnsha@arm.com>
* libsupc++/eh_arm.cc (__cxa_type_match): Handle foreign
exceptions.
* libsubpc++/eh_personality.cc: Don't try to set up foreign or
forced unwind types here when using the ARM EABI unwinder.
R.
*** eh_arm.cc (revision 125005)
--- eh_arm.cc (local)
*************** __cxa_type_match(_Unwind_Exception* ue_h
*** 46,56 ****
bool is_reference __attribute__((__unused__)),
void** thrown_ptr_p)
{
! if (!__is_gxx_exception_class(ue_header->exception_class))
! return ctm_failed;
!
__cxa_exception* xh = __get_exception_header_from_ue(ue_header);
! const std::type_info* throw_type = xh->exceptionType;
void* thrown_ptr = *thrown_ptr_p;
// Pointer types need to adjust the actual pointer, not
--- 46,61 ----
bool is_reference __attribute__((__unused__)),
void** thrown_ptr_p)
{
! bool foreign_exception = !__is_gxx_exception_class(ue_header->exception_class);
__cxa_exception* xh = __get_exception_header_from_ue(ue_header);
! const std::type_info* throw_type;
!
! // XXX What to do with forced unwind?
! if (foreign_exception)
! throw_type = &typeid(abi::__foreign_exception);
! else
! throw_type = xh->exceptionType;
!
void* thrown_ptr = *thrown_ptr_p;
// Pointer types need to adjust the actual pointer, not
*** eh_personality.cc (revision 125005)
--- eh_personality.cc (local)
*************** PERSONALITY_FUNCTION (int version,
*** 542,547 ****
--- 542,553 ----
bool saw_cleanup = false;
bool saw_handler = false;
+ #ifdef __ARM_EABI_UNWINDER__
+ throw_type = ue_header;
+ if ((actions & _UA_FORCE_UNWIND)
+ || foreign_exception)
+ thrown_ptr = 0;
+ #else
// During forced unwinding, match a magic exception type.
if (actions & _UA_FORCE_UNWIND)
{
*************** PERSONALITY_FUNCTION (int version,
*** 556,564 ****
thrown_ptr = 0;
}
else
- #ifdef __ARM_EABI_UNWINDER__
- throw_type = ue_header;
- #else
throw_type = xh->exceptionType;
#endif
--- 562,567 ----