aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Earnshaw <rearnsha@arm.com>2007-06-13 19:31:58 +0000
committerRichard Earnshaw <rearnsha@gcc.gnu.org>2007-06-13 19:31:58 +0000
commitddb4f387ee60618b1cb04d2143b47f808f9c9e02 (patch)
tree192108f6e223cc6ce0e5ddafcb6dd72d42e86d70
parent29dc9e20114a1b70e01fe6fec5d329c06b75718d (diff)
downloadgcc-ddb4f387ee60618b1cb04d2143b47f808f9c9e02.zip
gcc-ddb4f387ee60618b1cb04d2143b47f808f9c9e02.tar.gz
gcc-ddb4f387ee60618b1cb04d2143b47f808f9c9e02.tar.bz2
eh_arm.cc (__cxa_type_match): Handle foreign exceptions.
* 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. From-SVN: r125683
-rw-r--r--libstdc++-v3/ChangeLog7
-rw-r--r--libstdc++-v3/libsupc++/eh_arm.cc13
-rw-r--r--libstdc++-v3/libsupc++/eh_personality.cc9
3 files changed, 22 insertions, 7 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index ec10c58..2e4bdd7 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,10 @@
+2007-06-13 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.
+
2007-06-13 Paolo Carlini <pcarlini@suse.de>
* include/c_global/cmath: Tweak includes.
diff --git a/libstdc++-v3/libsupc++/eh_arm.cc b/libstdc++-v3/libsupc++/eh_arm.cc
index 87fccba..e1e4851 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 bbcc007..f1cda0c 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