unwind-cxx.h (__is_gxx_forced_unwind_class, [...]): Define for ARM EABI unwinder.
authorJoseph Myers <joseph@codesourcery.com>
Thu, 10 Jul 2008 00:57:16 +0000 (01:57 +0100)
committerJoseph Myers <jsm28@gcc.gnu.org>
Thu, 10 Jul 2008 00:57:16 +0000 (01:57 +0100)
* 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.

From-SVN: r137683

libstdc++-v3/ChangeLog
libstdc++-v3/libsupc++/eh_arm.cc
libstdc++-v3/libsupc++/eh_personality.cc
libstdc++-v3/libsupc++/unwind-cxx.h

index 41acdb5120f2a7a5b2e2cd8b5561fcf181f47ed7..4271416deb9a2778ad1f5a38996caa13b4abb7b0 100644 (file)
@@ -1,3 +1,13 @@
+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
index e1e4851604b5bf66bcbccce7064250f8493aa1e9..6f770e95663ca4bc5f8e38f5fde98bb078dbfb21 100644 (file)
@@ -46,12 +46,14 @@ __cxa_type_match(_Unwind_Exception* ue_header,
                 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;
index 86cfbafc2290130b8adc4ed21418fc9199f1da21..b7d957c4d3766101539cad58bc151dc2c5e22844 100644 (file)
@@ -544,8 +544,12 @@ PERSONALITY_FUNCTION (int version,
 
 #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.
index c5636556434084c2158dbde1c5598775b84b59b8..75874fc5da41902c5f6d5e519b15b4d82940a126 100644 (file)
@@ -201,6 +201,32 @@ __GXX_INIT_EXCEPTION_CLASS(_Unwind_Exception_Class c)
   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)
 {