summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2019-03-11 06:41:17 -0400
committermidipix <writeonce@midipix.org>2019-03-12 02:53:39 -0400
commit3f15a75d2f059828a390477eb9667ff36ff07f1b (patch)
treef190821d73406f824b38d0ab79f4fb2e0c9bf94f
parentb5865d2ba8b96feb0b4c431cee7f6860098414a9 (diff)
downloadcbb-gcc-4.6.4-3f15a75d2f059828a390477eb9667ff36ff07f1b.tar.bz2
cbb-gcc-4.6.4-3f15a75d2f059828a390477eb9667ff36ff07f1b.tar.xz
libsupc++/eh_personality.cc: support target-provided exception filters.
-rw-r--r--libstdc++-v3/libsupc++/eh_personality.cc27
1 files changed, 27 insertions, 0 deletions
diff --git a/libstdc++-v3/libsupc++/eh_personality.cc b/libstdc++-v3/libsupc++/eh_personality.cc
index 19c204473..3ef761515 100644
--- a/libstdc++-v3/libsupc++/eh_personality.cc
+++ b/libstdc++-v3/libsupc++/eh_personality.cc
@@ -24,6 +24,10 @@
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
+#ifdef TARGET_PERSONALITY_FUNCTION_MIDIPIX
+#include <../../gcc/unwind-midipix.h>
+#endif
+
#include <bits/c++config.h>
#include <cstdlib>
#include <bits/exception_defines.h>
@@ -343,11 +347,18 @@ namespace __cxxabiv1
#ifdef _GLIBCXX_SJLJ_EXCEPTIONS
#define PERSONALITY_FUNCTION __gxx_personality_sj0
#define __builtin_eh_return_data_regno(x) x
+#elif defined(TARGET_PERSONALITY_FUNCTION)
+#define PERSONALITY_FUNCTION __gxx_personality_imp
#else
#define PERSONALITY_FUNCTION __gxx_personality_v0
#endif
+#ifdef TARGET_PERSONALITY_FUNCTION
+static _Unwind_Reason_Code
+#else
extern "C" _Unwind_Reason_Code
+#endif
+
#ifdef __ARM_EABI_UNWINDER__
PERSONALITY_FUNCTION (_Unwind_State state,
struct _Unwind_Exception* ue_header,
@@ -718,6 +729,22 @@ PERSONALITY_FUNCTION (int version,
return _URC_INSTALL_CONTEXT;
}
+#ifdef TARGET_PERSONALITY_FUNCTION_MIDIPIX
+
+extern "C"
+int __gxx_personality_seh0(
+ struct _nt_exception_record * erec,
+ void * this_frame,
+ mcontext_t * tctx,
+ struct _nt_dispatcher_context * dctx)
+{
+ return __unwind_exception_filter(
+ erec,this_frame,tctx,dctx,
+ __gxx_personality_imp);
+}
+
+#endif
+
/* The ARM EABI implementation of __cxa_call_unexpected is in a
different file so that the personality routine (PR) can be used
standalone. The generic routine shared datastructures with the PR