2007-10-19 Marek Habersack <mhabersack@novell.com>
[mono.git] / mono / mini / exceptions-s390.c
index 620ce0f46a771e42d5c2fd9517ede4d718d6fff6..1aad39a1b33a70247bf2eb456682d3e336cc4cb0 100644 (file)
@@ -460,8 +460,7 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls,
                *managed = FALSE;
 
        if (ji != NULL) {
-               char *source_location, *tmpaddr, *fname;
-               gint32 address, iloffset;
+               gint32 address;
 
                *new_ctx = *ctx;
 
@@ -479,33 +478,12 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls,
                        if (!ji->method->wrapper_type)
                                *managed = TRUE;
 
-               if (trace) {
-                       source_location = mono_debug_source_location_from_address (ji->method, address, NULL, domain);
-                       iloffset = mono_debug_il_offset_from_address (ji->method, address, domain);
-
-                       if (iloffset < 0)
-                               tmpaddr = g_strdup_printf ("<0x%08x>", address);
-                       else
-                               tmpaddr = g_strdup_printf ("[0x%08x]", iloffset);
-               
-                       fname = mono_method_full_name (ji->method, TRUE);
-
-                       if (source_location)
-                               *trace = g_strdup_printf ("in %s (at %s) %s", tmpaddr, source_location, fname);
-                       else
-                               *trace = g_strdup_printf ("in %s %s", tmpaddr, fname);
-
-                       g_free (fname);
-                       g_free (source_location);
-                       g_free (tmpaddr);
-               }
                sframe = (MonoS390StackFrame *) MONO_CONTEXT_GET_SP (ctx);
                MONO_CONTEXT_SET_BP (new_ctx, sframe->prev);
                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;
+               return ji;
        } else if (*lmf) {
                
                *new_ctx = *ctx;
@@ -513,11 +491,7 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls,
                if (!(*lmf)->method)
                        return (gpointer)-1;
 
-               if (trace)
-                       *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;
@@ -530,8 +504,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;
@@ -632,7 +605,7 @@ mono_arch_is_int_overflow (void *uc, void *info)
                case 0x5d :             /* Divide                   */
                        regNo   = (code[2] & 0xf0 >> 8);        
                        offset  = *((guint16 *) code+2) & 0x0fff;
-                       operand = ctx->uc_mcontext.gregs[regNo] + offset;
+                       operand = (guint32*)(ctx->uc_mcontext.gregs[regNo] + offset);
                        if (*operand == 0)
                                arithExc = FALSE; 
                break;
@@ -647,7 +620,7 @@ mono_arch_is_int_overflow (void *uc, void *info)
                        if (code[1] == 0x97) {  
                                regNo   = (code[2] & 0xf0 >> 8);        
                                offset  = *((guint32 *) code+1) & 0x000fffff;
-                               operand = ctx->uc_mcontext.gregs[regNo] + offset;
+                               operand = (guint32*)(ctx->uc_mcontext.gregs[regNo] + offset);
                                if (*operand == 0)
                                        arithExc = FALSE; 
                        }
@@ -655,7 +628,7 @@ mono_arch_is_int_overflow (void *uc, void *info)
                default:
                        arithExc = TRUE;
        }
-       ctx->uc_mcontext.psw.addr = code;
+       ctx->uc_mcontext.psw.addr = (guint32)code;
        return (arithExc);
 }