diff options
author | Joseph Myers <joseph@codesourcery.com> | 2008-07-10 01:57:16 +0100 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2008-07-10 01:57:16 +0100 |
commit | e32717fc8929c80c03c13fbd584437d93605acff (patch) | |
tree | f597df4271f339e12159827b75c215f562f335c8 /libstdc++-v3/libsupc++ | |
parent | a222c04e0220207e42495df7c93366a337a7d9eb (diff) | |
download | gcc-e32717fc8929c80c03c13fbd584437d93605acff.zip gcc-e32717fc8929c80c03c13fbd584437d93605acff.tar.gz gcc-e32717fc8929c80c03c13fbd584437d93605acff.tar.bz2 |
unwind-cxx.h (__is_gxx_forced_unwind_class, [...]): Define for ARM EABI unwinder.
* 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
Diffstat (limited to 'libstdc++-v3/libsupc++')
-rw-r--r-- | libstdc++-v3/libsupc++/eh_arm.cc | 8 | ||||
-rw-r--r-- | libstdc++-v3/libsupc++/eh_personality.cc | 8 | ||||
-rw-r--r-- | libstdc++-v3/libsupc++/unwind-cxx.h | 26 |
3 files changed, 37 insertions, 5 deletions
diff --git a/libstdc++-v3/libsupc++/eh_arm.cc b/libstdc++-v3/libsupc++/eh_arm.cc index e1e4851..6f770e9 100644 --- a/libstdc++-v3/libsupc++/eh_arm.cc +++ b/libstdc++-v3/libsupc++/eh_arm.cc @@ -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; diff --git a/libstdc++-v3/libsupc++/eh_personality.cc b/libstdc++-v3/libsupc++/eh_personality.cc index 86cfbaf..b7d957c 100644 --- a/libstdc++-v3/libsupc++/eh_personality.cc +++ b/libstdc++-v3/libsupc++/eh_personality.cc @@ -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. diff --git a/libstdc++-v3/libsupc++/unwind-cxx.h b/libstdc++-v3/libsupc++/unwind-cxx.h index c563655..75874fc 100644 --- a/libstdc++-v3/libsupc++/unwind-cxx.h +++ b/libstdc++-v3/libsupc++/unwind-cxx.h @@ -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) { |