+2008-07-09 Joseph Myers <joseph@codesourcery.com>
+
+ * libsupc++/unwind-cxx.h (__is_gxx_forced_unwind_class,
+ __GXX_INIT_FORCED_UNWIND_CLASS): Define for ARM EABI unwinder.
+ * libsupc++/eh_personality.cc (PERSONALITY_FUNCTION): Call
+ __GXX_INIT_FORCED_UNWIND_CLASS for forced unwind with ARM EABI
+ unwinder.
+ * libsupc++/eh_arm.cc (__cxa_type_match): Use
+ __is_gxx_forced_unwind_class to check for forced unwind.
+
2008-07-09 Andreas Beckmann <gcc@abeckmann.de>
PR libstdc++/36552
bool is_reference __attribute__((__unused__)),
void** thrown_ptr_p)
{
- bool foreign_exception = !__is_gxx_exception_class(ue_header->exception_class);
+ bool forced_unwind = __is_gxx_forced_unwind_class(ue_header->exception_class);
+ bool foreign_exception = !forced_unwind && !__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)
+ if (forced_unwind)
+ throw_type = &typeid(abi::__forced_unwind);
+ else if (foreign_exception)
throw_type = &typeid(abi::__foreign_exception);
else
throw_type = xh->exceptionType;
#ifdef __ARM_EABI_UNWINDER__
throw_type = ue_header;
- if ((actions & _UA_FORCE_UNWIND)
- || foreign_exception)
+ if (actions & _UA_FORCE_UNWIND)
+ {
+ __GXX_INIT_FORCED_UNWIND_CLASS(ue_header->exception_class);
+ thrown_ptr = 0;
+ }
+ else if (foreign_exception)
thrown_ptr = 0;
#else
// During forced unwinding, match a magic exception type.
c[7] = '\0';
}
+static inline bool
+__is_gxx_forced_unwind_class(_Unwind_Exception_Class c)
+{
+ return c[0] == 'G'
+ && c[1] == 'N'
+ && c[2] == 'U'
+ && c[3] == 'C'
+ && c[4] == 'F'
+ && c[5] == 'O'
+ && c[6] == 'R'
+ && c[7] == '\0';
+}
+
+static inline void
+__GXX_INIT_FORCED_UNWIND_CLASS(_Unwind_Exception_Class c)
+{
+ c[0] = 'G';
+ c[1] = 'N';
+ c[2] = 'U';
+ c[3] = 'C';
+ c[4] = 'F';
+ c[5] = 'O';
+ c[6] = 'R';
+ c[7] = '\0';
+}
+
static inline void*
__gxx_caught_object(_Unwind_Exception* eo)
{