From f0f54e7784d206115bdb62e19dc493e8aade27c4 Mon Sep 17 00:00:00 2001 From: rearnsha Date: Wed, 13 Jun 2007 19:31:58 +0000 Subject: [PATCH] * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125683 138bc75d-0d04-0410-961f-82ee72b054a4 --- libstdc++-v3/ChangeLog | 7 +++++++ libstdc++-v3/libsupc++/eh_arm.cc | 13 +++++++++---- libstdc++-v3/libsupc++/eh_personality.cc | 9 ++++++--- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index ec10c586d68..2e4bdd7b7e3 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +2007-06-13 Richard Earnshaw + + * 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. + 2007-06-13 Paolo Carlini * include/c_global/cmath: Tweak includes. diff --git a/libstdc++-v3/libsupc++/eh_arm.cc b/libstdc++-v3/libsupc++/eh_arm.cc index 87fccba0aac..e1e4851604b 100644 --- a/libstdc++-v3/libsupc++/eh_arm.cc +++ b/libstdc++-v3/libsupc++/eh_arm.cc @@ -46,11 +46,16 @@ __cxa_type_match(_Unwind_Exception* ue_header, bool is_reference __attribute__((__unused__)), void** thrown_ptr_p) { - if (!__is_gxx_exception_class(ue_header->exception_class)) - return ctm_failed; - + 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 = xh->exceptionType; + 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 diff --git a/libstdc++-v3/libsupc++/eh_personality.cc b/libstdc++-v3/libsupc++/eh_personality.cc index bbcc0072730..f1cda0c1bbf 100644 --- a/libstdc++-v3/libsupc++/eh_personality.cc +++ b/libstdc++-v3/libsupc++/eh_personality.cc @@ -542,6 +542,12 @@ PERSONALITY_FUNCTION (int version, 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) { @@ -556,9 +562,6 @@ PERSONALITY_FUNCTION (int version, thrown_ptr = 0; } else -#ifdef __ARM_EABI_UNWINDER__ - throw_type = ue_header; -#else throw_type = xh->exceptionType; #endif -- 2.11.0