Merge pull request #992 from ludovic-henry/ludovic-counters-pr1
[mono.git] / mono / mini / exceptions-ia64.c
index 3936d11b829b104ceb2ea696d6c295745828bad4..b8212c684bd3d47b5c3d5b32ca361319def675ad 100644 (file)
@@ -266,7 +266,7 @@ throw_exception (MonoObject *exc, guint64 rethrow)
 
                ji = mini_jit_info_table_find (mono_domain_get (), (gpointer)ip, NULL);
 
-               //printf ("UN: %s %lx %lx\n", ji ? ji->method->name : "", ip, sp);
+               //printf ("UN: %s %lx %lx\n", ji ? jinfo_get_method (ji)->name : "", ip, sp);
 
                if (ji)
                        break;
@@ -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,53 +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);
-
-               ji = mini_jit_info_table_find (domain, (gpointer)ip, NULL);
-
-               /*
-               {
-                       char name[256];
-                       unw_word_t off;
+       if (!ji) {
+               while (TRUE) {
+                       err = unw_get_reg (&new_ctx->cursor, UNW_IA64_IP, &ip);
+                       g_assert (err == 0);
 
-                       unw_get_proc_name (&new_ctx->cursor, name, 256, &off);
-                       printf ("F: %s\n", name);
-               }
-               */
+                       ji = mini_jit_info_table_find (domain, (gpointer)ip, NULL);
 
-               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);
 
@@ -566,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;
@@ -598,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);