Don't run test-318 with gmcs.
[mono.git] / mono / mini / mini-exceptions.c
index 1270ec1b63e434dbe1655393dbfc4defe8929d35..ce350f6fcd68f4b3380b04eb694b9497e6ebf585 100644 (file)
@@ -155,7 +155,7 @@ ves_icall_get_trace (MonoException *exc, gint32 skip, MonoBoolean need_file_info
 }
 
 void
-mono_jit_walk_stack (MonoStackWalk func, gpointer user_data) {
+mono_jit_walk_stack (MonoStackWalk func, gboolean do_il_offset, gpointer user_data) {
        MonoDomain *domain = mono_domain_get ();
        MonoJitTlsData *jit_tls = TlsGetValue (mono_jit_tls_id);
        MonoLMF *lmf = jit_tls->lmf;
@@ -178,7 +178,7 @@ mono_jit_walk_stack (MonoStackWalk func, gpointer user_data) {
                if (ji == (gpointer)-1)
                        return;
 
-               il_offset = mono_debug_il_offset_from_address (ji->method, native_offset, domain);
+               il_offset = do_il_offset ? mono_debug_il_offset_from_address (ji->method, native_offset, domain): -1;
 
                if (func (ji->method, native_offset, il_offset, managed, user_data))
                        return;
@@ -216,6 +216,8 @@ ves_icall_get_frame_info (gint32 skip, MonoBoolean need_file_info,
 
                /* skip all wrappers ??*/
                if (ji->method->wrapper_type == MONO_WRAPPER_RUNTIME_INVOKE ||
+                   ji->method->wrapper_type == MONO_WRAPPER_XDOMAIN_INVOKE ||
+                   ji->method->wrapper_type == MONO_WRAPPER_XDOMAIN_DISPATCH ||
                    ji->method->wrapper_type == MONO_WRAPPER_REMOTING_INVOKE_WITH_CHECK ||
                    ji->method->wrapper_type == MONO_WRAPPER_REMOTING_INVOKE)
                        continue;
@@ -348,7 +350,7 @@ mono_handle_exception (MonoContext *ctx, gpointer obj, gpointer original_ip, gbo
                                G_BREAKPOINT ();
                        mono_unhandled_exception (obj);
 
-                       if (mono_debugger_unhandled_exception (original_ip, obj)) {
+                       if (mono_debugger_unhandled_exception (original_ip, MONO_CONTEXT_GET_SP (ctx), obj)) {
                                /*
                                 * If this returns true, then we're running inside the
                                 * Mono Debugger and the debugger wants us to restore the
@@ -434,11 +436,13 @@ mono_handle_exception (MonoContext *ctx, gpointer obj, gpointer original_ip, gbo
                                                        }
                                                }
 
-                                               if (ei->flags == MONO_EXCEPTION_CLAUSE_FILTER)
+                                               if (ei->flags == MONO_EXCEPTION_CLAUSE_FILTER) {
+                                                       mono_debugger_handle_exception (ei->data.filter, MONO_CONTEXT_GET_SP (ctx), obj);
                                                        filtered = call_filter (ctx, ei->data.filter);
+                                               }
 
                                                if ((ei->flags == MONO_EXCEPTION_CLAUSE_NONE && 
-                                                    mono_object_isinst (obj, mono_class_get (ji->method->klass->image, ei->data.token))) || filtered) {
+                                                    mono_object_isinst (obj, ei->data.catch_class)) || filtered) {
                                                        if (test_only) {
                                                                if (mono_ex) {
                                                                        trace_ips = g_list_reverse (trace_ips);
@@ -455,6 +459,7 @@ mono_handle_exception (MonoContext *ctx, gpointer obj, gpointer original_ip, gbo
                                                        }
                                                        if (mono_jit_trace_calls != NULL && mono_trace_eval (ji->method))
                                                                g_print ("EXCEPTION: catch found at clause %d of %s\n", i, mono_method_full_name (ji->method, TRUE));
+                                                       mono_debugger_handle_exception (ei->handler_start, MONO_CONTEXT_GET_SP (ctx), obj);
                                                        MONO_CONTEXT_SET_IP (ctx, ei->handler_start);
                                                        jit_tls->lmf = lmf;
                                                        g_free (trace);
@@ -470,6 +475,7 @@ mono_handle_exception (MonoContext *ctx, gpointer obj, gpointer original_ip, gbo
                                                    (ei->flags & MONO_EXCEPTION_CLAUSE_FINALLY)) {
                                                        if (mono_jit_trace_calls != NULL && mono_trace_eval (ji->method))
                                                                g_print ("EXCEPTION: finally clause %d of %s\n", i, mono_method_full_name (ji->method, TRUE));
+                                                       mono_debugger_handle_exception (ei->handler_start, MONO_CONTEXT_GET_SP (ctx), obj);
                                                        call_filter (ctx, ei->handler_start);
                                                }