Merge pull request #1668 from alexanderkyte/bug1856
[mono.git] / mono / mini / exceptions-mips.c
index 8ab97bf5a30068e487b4fd27e97ca02fd8fed0ca..dfb4a57d3b9a3ff5418b7cb005b8f283ffbbd387 100644 (file)
@@ -77,6 +77,7 @@ mono_arch_get_restore_context (MonoTrampInfo **info, gboolean aot)
 
        g_assert ((code - start) < sizeof(start));
        mono_arch_flush_icache (start, code - start);
+       mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
        return start;
 }
 
@@ -168,6 +169,7 @@ mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot)
 
        g_assert ((code - start) < sizeof(start));
        mono_arch_flush_icache (start, code - start);
+       mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
        return start;
 }
 
@@ -194,8 +196,10 @@ throw_exception (MonoObject *exc, unsigned long eip, unsigned long esp, gboolean
 
        if (mono_object_isinst (exc, mono_defaults.exception_class)) {
                MonoException *mono_ex = (MonoException*)exc;
-               if (!rethrow)
+               if (!rethrow) {
                        mono_ex->stack_trace = NULL;
+                       mono_ex->trace_ips = NULL;
+               }
        }
        mono_handle_exception (&ctx, exc);
 #ifdef DEBUG_EXCEPTIONS
@@ -281,6 +285,7 @@ mono_arch_get_throw_exception_generic (guint8 *start, int size, int corlib, gboo
 
        g_assert ((code - start) < size);
        mono_arch_flush_icache (start, code - start);
+       mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
        return start;
 }
 
@@ -348,6 +353,7 @@ mono_arch_get_throw_exception_by_name (void)
        start = code = mono_global_codeman_reserve (size);
        mips_break (code, 0xfd);
        mono_arch_flush_icache (start, code - start);
+       mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
        return start;
 }