Merge pull request #488 from roji/email_attachment_fixes
[mono.git] / mono / mini / exceptions-ia64.c
index 6491657bb6ee8a28b1c620106a454585acf91576..85c7792be30fae4b8258fc864f744cab998efead 100644 (file)
@@ -284,7 +284,7 @@ throw_exception (MonoObject *exc, guint64 rethrow)
        }
        ctx.precise_ip = FALSE;
 
-       mono_handle_exception (&ctx, exc, (gpointer)(ip), FALSE);
+       mono_handle_exception (&ctx, exc);
        restore_context (&ctx);
 
        g_assert_not_reached ();
@@ -498,57 +498,53 @@ mono_arch_get_throw_corlib_exception (MonoTrampInfo **info, gboolean aot)
 gboolean
 mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls, 
                                                         MonoJitInfo *ji, MonoContext *ctx, 
-                                                        MonoContext *new_ctx, MonoLMF **lmf, 
+                                                        MonoContext *new_ctx, MonoLMF **lmf,
+                                                        mgreg_t **save_locations,
                                                         StackFrameInfo *frame)
 {
        int err;
        unw_word_t ip;
 
        memset (frame, 0, sizeof (StackFrameInfo));
-       frame->managed = FALSE;
+       frame->ji = ji;
 
        *new_ctx = *ctx;
        new_ctx->precise_ip = FALSE;
 
-       while (TRUE) {
-               err = unw_get_reg (&new_ctx->cursor, UNW_IA64_IP, &ip);
-               g_assert (err == 0);
+       if (!ji) {
+               while (TRUE) {
+                       err = unw_get_reg (&new_ctx->cursor, UNW_IA64_IP, &ip);
+                       g_assert (err == 0);
 
-               /* Avoid costly table lookup during stack overflow */
-               if (prev_ji && ((guint8*)ip > (guint8*)prev_ji->code_start && ((guint8*)ip < ((guint8*)prev_ji->code_start) + prev_ji->code_size)))
-                       ji = prev_ji;
-               else
                        ji = mini_jit_info_table_find (domain, (gpointer)ip, NULL);
 
-               /*
-               {
-                       char name[256];
-                       unw_word_t off;
-
-                       unw_get_proc_name (&new_ctx->cursor, name, 256, &off);
-                       printf ("F: %s\n", name);
-               }
-               */
-
-               if (ji != NULL) {
-                       break;
+                       /*
+                         {
+                         char name[256];
+                         unw_word_t off;
+
+                         unw_get_proc_name (&new_ctx->cursor, name, 256, &off);
+                         printf ("F: %s\n", name);
+                         }
+                       */
+
+                       if (ji)
+                               break;
+
+                       /* This is an unmanaged frame, so just unwind through it */
+                       /* FIXME: This returns -3 for the __clone2 frame in libc */
+                       err = unw_step (&new_ctx->cursor);
+                       if (err < 0)
+                               break;
+
+                       if (err == 0)
+                               break;
                }
-
-               /* This is an unmanaged frame, so just unwind through it */
-               /* FIXME: This returns -3 for the __clone2 frame in libc */
-               err = unw_step (&new_ctx->cursor);
-               if (err < 0)
-                       break;
-
-               if (err == 0)
-                       break;
        }
 
        if (ji) {
                frame->type = FRAME_TYPE_MANAGED;
-
-               if (!ji->method->wrapper_type || ji->method->wrapper_type == MONO_WRAPPER_DYNAMIC_METHOD)
-                       frame->managed = TRUE;
+               frame->ji = ji;
 
                //print_ctx (new_ctx);
 
@@ -570,7 +566,7 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls,
  * @obj: the exception object
  */
 gboolean
-mono_arch_handle_exception (void *sigctx, gpointer obj, gboolean test_only)
+mono_arch_handle_exception (void *sigctx, gpointer obj)
 {
        /* libunwind takes care of this */
        unw_context_t unw_ctx;
@@ -602,7 +598,7 @@ mono_arch_handle_exception (void *sigctx, gpointer obj, gboolean test_only)
        }
        ctx.precise_ip = TRUE;
 
-       mono_handle_exception (&ctx, obj, (gpointer)ip, test_only);
+       mono_handle_exception (&ctx, obj);
 
        restore_context (&ctx);