2005-01-31 Zoltan Varga <vargaz@freemail.hu>
[mono.git] / mono / mini / exceptions-s390x.c
index 45503d6cee9b3727427674845492497a377d1238..546714496602e133a59ff8306a6a9a5f7fa3d3a7 100644 (file)
@@ -215,36 +215,7 @@ init_frame_state_for (void)
 gboolean
 mono_arch_has_unwind_info (gconstpointer addr)
 {
-#if 0
-       struct frame_state state_in;
-       struct frame_state *res;
-
-       if (!inited) 
-               init_frame_state_for ();
-       
-       if (!frame_state_for)
-               return FALSE;
-
-       g_assert (method->addr);
-
-       memset (&state_in, 0, sizeof (state_in));
-
-       /* offset 10 is just a guess, but it works for all methods tested */
-       if ((res = frame_state_for ((char *)method->addr + 10, &state_in))) {
-
-               if (res->saved [X86_EBX] != 1 ||
-                   res->saved [X86_EDI] != 1 ||
-                   res->saved [X86_EBP] != 1 ||
-                   res->saved [X86_ESI] != 1) {
-                       return FALSE;
-               }
-               return TRUE;
-       } else {
-               return FALSE;
-       }
-#else
        return FALSE;
-#endif
 }
 
 /*========================= End of Function ========================*/
@@ -747,13 +718,7 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls,
                sframe = (MonoS390StackFrame *) sframe->prev;
                MONO_CONTEXT_SET_IP (new_ctx, sframe->return_address);
                memcpy (&new_ctx->uc_mcontext.gregs[6], sframe->regs, (8*sizeof(gint32)));
-               *res = *ji;
-               return res;
-#ifdef MONO_USE_EXC_TABLES
-       } else if ((ji = s390_unwind_native_frame (domain, jit_tls, ctx, new_ctx, *lmf, trace))) {
-               *res = *ji;
-               return res;
-#endif
+               return ji;
        } else if (*lmf) {
                
                *new_ctx = *ctx;
@@ -765,7 +730,6 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls,
                        *trace = g_strdup_printf ("in (unmanaged) %s", mono_method_full_name ((*lmf)->method, TRUE));
                
                if ((ji = mono_jit_info_table_find (domain, (gpointer)(*lmf)->eip))) {
-                       *res = *ji;
                } else {
                        memset (res, 0, sizeof (MonoJitInfo));
                        res->method = (*lmf)->method;
@@ -782,8 +746,7 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls,
                MONO_CONTEXT_SET_IP (new_ctx, (*lmf)->eip);
                *lmf = (*lmf)->previous_lmf;
 
-               return res;
-               
+               return ji ? ji : res;
        }
 
        return NULL;
@@ -860,7 +823,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;
@@ -882,7 +845,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;
@@ -930,6 +893,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;
@@ -1059,7 +1024,7 @@ mono_arch_handle_exception (void *uc, gpointer obj, gboolean test_only)
                                            MONO_CONTEXT_GET_IP (ctx) <= ei->try_end) { 
                                                /* catch block */
                                                if ((ei->flags == MONO_EXCEPTION_CLAUSE_NONE && 
-                                                    mono_object_isinst (obj, mono_class_get (ji->method->klass->image, ei->data.token))) ||
+                                                    mono_object_isinst (obj, ei->data.catch_class)) ||
                                                    ((ei->flags == MONO_EXCEPTION_CLAUSE_FILTER &&
                                                      call_filter (ctx, ei->data.filter, obj)))) {
                                                        if (test_only) {