X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmini%2Fexceptions-ia64.c;h=b8212c684bd3d47b5c3d5b32ca361319def675ad;hb=46cccd7feb93e124594e2b225dbca2b3ab0164ea;hp=734893334ca9ff3fda921f8d7b760ee4104c7e88;hpb=9a3b4f0d2665c3559b1f6caed45889414405795c;p=mono.git diff --git a/mono/mini/exceptions-ia64.c b/mono/mini/exceptions-ia64.c index 734893334ca..b8212c684bd 100644 --- a/mono/mini/exceptions-ia64.c +++ b/mono/mini/exceptions-ia64.c @@ -266,7 +266,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; @@ -284,7 +284,7 @@ throw_exception (MonoObject *exc, guint64 rethrow) } ctx.precise_ip = FALSE; - mono_handle_exception (&ctx, exc, (gpointer)(ip), FALSE); + mono_handle_exception (&ctx, exc); restore_context (&ctx); g_assert_not_reached (); @@ -487,68 +487,65 @@ mono_arch_get_throw_corlib_exception (MonoTrampInfo **info, gboolean aot) return res; } -/* mono_arch_find_jit_info: +/* + * mono_arch_find_jit_info: * - * This function is used to gather information from @ctx. It return the - * MonoJitInfo of the corresponding function, unwinds one stack frame and - * stores the resulting context into @new_ctx. It also stores a string - * describing the stack location into @trace (if not NULL), and modifies - * the @lmf if necessary. @native_offset return the IP offset from the - * start of the function or -1 if that info is not available. + * 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 + * is modified if needed. + * Returns TRUE on success, FALSE otherwise. */ -MonoJitInfo * -mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls, MonoJitInfo *res, MonoJitInfo *prev_ji, MonoContext *ctx, - MonoContext *new_ctx, MonoLMF **lmf, gboolean *managed) +gboolean +mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls, + MonoJitInfo *ji, MonoContext *ctx, + MonoContext *new_ctx, MonoLMF **lmf, + mgreg_t **save_locations, + StackFrameInfo *frame) { - MonoJitInfo *ji; int err; unw_word_t ip; + memset (frame, 0, sizeof (StackFrameInfo)); + frame->ji = ji; + *new_ctx = *ctx; new_ctx->precise_ip = FALSE; - while (TRUE) { - err = unw_get_reg (&new_ctx->cursor, UNW_IA64_IP, &ip); - g_assert (err == 0); + if (!ji) { + while (TRUE) { + err = unw_get_reg (&new_ctx->cursor, UNW_IA64_IP, &ip); + g_assert (err == 0); - /* Avoid costly table lookup during stack overflow */ - if (prev_ji && ((guint8*)ip > (guint8*)prev_ji->code_start && ((guint8*)ip < ((guint8*)prev_ji->code_start) + prev_ji->code_size))) - ji = prev_ji; - else ji = mini_jit_info_table_find (domain, (gpointer)ip, NULL); - if (managed) - *managed = FALSE; - - /* - { - char name[256]; - unw_word_t off; - - unw_get_proc_name (&new_ctx->cursor, name, 256, &off); - printf ("F: %s\n", name); - } - */ - - if (ji != NULL) { - if (managed) - if (!ji->method->wrapper_type) - *managed = TRUE; - - break; + /* + { + char name[256]; + unw_word_t off; + + unw_get_proc_name (&new_ctx->cursor, name, 256, &off); + printf ("F: %s\n", name); + } + */ + + if (ji) + break; + + /* This is an unmanaged frame, so just unwind through it */ + /* FIXME: This returns -3 for the __clone2 frame in libc */ + err = unw_step (&new_ctx->cursor); + if (err < 0) + break; + + if (err == 0) + break; } - - /* This is an unmanaged frame, so just unwind through it */ - /* FIXME: This returns -3 for the __clone2 frame in libc */ - err = unw_step (&new_ctx->cursor); - if (err < 0) - break; - - if (err == 0) - break; } if (ji) { + frame->type = FRAME_TYPE_MANAGED; + frame->ji = ji; + //print_ctx (new_ctx); err = unw_step (&new_ctx->cursor); @@ -556,10 +553,10 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls, MonoJitInf //print_ctx (new_ctx); - return ji; + return TRUE; } else - return (gpointer)(gssize)-1; + return FALSE; } /** @@ -569,7 +566,7 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls, MonoJitInf * @obj: the exception object */ gboolean -mono_arch_handle_exception (void *sigctx, gpointer obj, gboolean test_only) +mono_arch_handle_exception (void *sigctx, gpointer obj) { /* libunwind takes care of this */ unw_context_t unw_ctx; @@ -601,7 +598,7 @@ mono_arch_handle_exception (void *sigctx, gpointer obj, gboolean test_only) } ctx.precise_ip = TRUE; - mono_handle_exception (&ctx, obj, (gpointer)ip, test_only); + mono_handle_exception (&ctx, obj); restore_context (&ctx);