[interp] make mixed mode work on arm
authorBernhard Urban <bernhard.urban@xamarin.com>
Wed, 17 May 2017 11:40:58 +0000 (13:40 +0200)
committerBernhard Urban <bernhard.urban@xamarin.com>
Wed, 17 May 2017 15:36:43 +0000 (17:36 +0200)
mono/mini/exceptions-arm.c
mono/mini/mini-exceptions.c

index 109dd60841b6d78af03ab4127a3eea3f26a79862..dac83f0bb43552682bc79bb91749fc6bc39f3940 100644 (file)
@@ -465,20 +465,24 @@ mono_arch_unwind_frame (MonoDomain *domain, MonoJitTlsData *jit_tls,
        } else if (*lmf) {
 
                if (((gsize)(*lmf)->previous_lmf) & 2) {
-                       /* 
-                        * This LMF entry is created by the soft debug code to mark transitions to
-                        * managed code done during invokes.
-                        */
                        MonoLMFExt *ext = (MonoLMFExt*)(*lmf);
 
-                       g_assert (ext->debugger_invoke);
-
-                       memcpy (new_ctx, &ext->ctx, sizeof (MonoContext));
+                       if (ext->debugger_invoke) {
+                               /*
+                                * This LMF entry is created by the soft debug code to mark transitions to
+                                * managed code done during invokes.
+                                */
+                               frame->type = FRAME_TYPE_DEBUGGER_INVOKE;
+                               memcpy (new_ctx, &ext->ctx, sizeof (MonoContext));
+                       } else if (ext->interp_exit) {
+                               frame->type = FRAME_TYPE_INTERP_TO_MANAGED;
+                               frame->interp_exit_data = ext->interp_exit_data;
+                       } else {
+                               g_assert_not_reached ();
+                       }
 
                        *lmf = (gpointer)(((gsize)(*lmf)->previous_lmf) & ~3);
 
-                       frame->type = FRAME_TYPE_DEBUGGER_INVOKE;
-
                        return TRUE;
                }
 
index f03d962cbbf2b6879aaa71108f9bfa746339e4ac..e612fdf73ba1640ddf3bfd7250853e46bfbc1f8c 100644 (file)
@@ -2131,6 +2131,10 @@ mono_handle_exception_internal (MonoContext *ctx, MonoObject *obj, gboolean resu
                                                /* Undo the IP adjustment done by mono_arch_unwind_frame () */
 #if defined(TARGET_AMD64)
                                                ctx->gregs [AMD64_RIP] ++;
+#elif defined(TARGET_ARM)
+                                               ctx->pc ++;
+                                               /* set thumb bit */
+                                               ctx->pc |= 1;
 #elif defined(TARGET_ARM64)
                                                ctx->pc ++;
 #else