Merge pull request #2819 from BrzVlad/fix-major-log
[mono.git] / mono / mini / exceptions-ia64.c
index 85c7792be30fae4b8258fc864f744cab998efead..adae20f2b5f2fb83a57d67b3b08b30a77f007483 100644 (file)
@@ -29,7 +29,7 @@
 #include <mono/metadata/threads.h>
 #include <mono/metadata/debug-helpers.h>
 #include <mono/metadata/exception.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/metadata/mono-debug.h>
 
 #include "mini.h"
@@ -236,16 +236,20 @@ static void
 throw_exception (MonoObject *exc, guint64 rethrow)
 {
        unw_context_t unw_ctx;
+       MonoError error;
        MonoContext ctx;
        MonoJitInfo *ji;
        unw_word_t ip, sp;
        int res;
 
-       if (mono_object_isinst (exc, mono_defaults.exception_class)) {
+       if (mono_object_isinst_checked (exc, mono_defaults.exception_class, &error)) {
                MonoException *mono_ex = (MonoException*)exc;
-               if (!rethrow)
+               if (!rethrow) {
                        mono_ex->stack_trace = NULL;
+                       mono_ex->trace_ips = NULL;
+               }
        }
+       mono_error_assert_ok (&error);
 
        res = unw_getcontext (&unw_ctx);
        g_assert (res == 0);
@@ -266,7 +270,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;
@@ -488,7 +492,7 @@ mono_arch_get_throw_corlib_exception (MonoTrampInfo **info, gboolean aot)
 }
 
 /*
- * mono_arch_find_jit_info:
+ * mono_arch_unwind_frame:
  *
  * This function is used to gather information from @ctx, and store it in @frame_info.
  * It unwinds one stack frame, and stores the resulting context into @new_ctx. @lmf
@@ -496,7 +500,7 @@ mono_arch_get_throw_corlib_exception (MonoTrampInfo **info, gboolean aot)
  * Returns TRUE on success, FALSE otherwise.
  */
 gboolean
-mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls, 
+mono_arch_unwind_frame (MonoDomain *domain, MonoJitTlsData *jit_tls, 
                                                         MonoJitInfo *ji, MonoContext *ctx, 
                                                         MonoContext *new_ctx, MonoLMF **lmf,
                                                         mgreg_t **save_locations,
@@ -543,7 +547,10 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls,
        }
 
        if (ji) {
-               frame->type = FRAME_TYPE_MANAGED;
+               if (ji->is_trampoline)
+                       frame->type = FRAME_TYPE_TRAMPOLINE;
+               else
+                       frame->type = FRAME_TYPE_MANAGED;
                frame->ji = ji;
 
                //print_ctx (new_ctx);