[mono-error] mono_class_from_name and mono_class_from_name_case now can cleanly retur...
[mono.git] / mono / mini / exceptions-sparc.c
index 0c47d9da31754931352844b2785184164330fe7a..d9b3d9d99c658bfc396ef0e01aa21af3633d7a03 100644 (file)
@@ -21,7 +21,7 @@
 #include <mono/metadata/debug-helpers.h>
 #include <mono/metadata/exception.h>
 #include <mono/metadata/mono-debug.h>
-#include <mono/metadata/gc-internal.h>
+#include <mono/metadata/gc-internals.h>
 #include <mono/metadata/tokentype.h>
 
 #include "mini.h"
@@ -180,10 +180,12 @@ throw_exception (MonoObject *exc, gpointer sp, gpointer ip, gboolean rethrow)
 
        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, ip, FALSE);
+       mono_handle_exception (&ctx, exc);
        restore_context (&ctx);
 
        g_assert_not_reached ();
@@ -324,7 +326,7 @@ mono_arch_get_throw_corlib_exception (MonoTrampInfo **info, gboolean aot)
        return start;
 }
 
-/* mono_arch_find_jit_info:
+/* mono_arch_unwind_frame:
  *
  * This function is used to gather information from @ctx. It return the 
  * MonoJitInfo of the corresponding function, unwinds one stack frame and
@@ -334,7 +336,7 @@ mono_arch_get_throw_corlib_exception (MonoTrampInfo **info, gboolean aot)
  * start of the function or -1 if that info is not available.
  */
 gboolean
-mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls, 
+mono_arch_unwind_frame (MonoDomain *domain, MonoJitTlsData *jit_tls, 
                                                         MonoJitInfo *ji, MonoContext *ctx, 
                                                         MonoContext *new_ctx, MonoLMF **lmf,
                                                         mgreg_t **save_locations,
@@ -344,17 +346,14 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls,
 
        memset (frame, 0, sizeof (StackFrameInfo));
        frame->ji = ji;
-       frame->managed = FALSE;
 
        *new_ctx = *ctx;
 
        if (ji != NULL) {
-               frame->type = FRAME_TYPE_MANAGED;
-
-               if (*lmf && (MONO_CONTEXT_GET_BP (ctx) >= (gpointer)(*lmf)->ebp)) {
-                       /* remove any unused lmf */
-                       *lmf = (*lmf)->previous_lmf;
-               }
+               if (ji->is_trampoline)
+                       frame->type = FRAME_TYPE_TRAMPOLINE;
+               else
+                       frame->type = FRAME_TYPE_MANAGED;
 
                /* Restore ip and sp from the saved register window */
                window = MONO_SPARC_WINDOW_ADDR (ctx->sp);
@@ -388,16 +387,10 @@ mono_arch_find_jit_info (MonoDomain *domain, MonoJitTlsData *jit_tls,
        }
 }
 
-gboolean
-mono_arch_has_unwind_info (gconstpointer addr)
-{
-       return FALSE;
-}
-
 #ifdef __linux__
 
 gboolean
-mono_arch_handle_exception (void *sigctx, gpointer obj, gboolean test_only)
+mono_arch_handle_exception (void *sigctx, gpointer obj)
 {
        MonoContext mctx;
        struct sigcontext *sc = sigctx;
@@ -414,7 +407,7 @@ mono_arch_handle_exception (void *sigctx, gpointer obj, gboolean test_only)
        window = (gpointer*)(((guint8*)mctx.sp) + MONO_SPARC_STACK_BIAS);
        mctx.fp = window [sparc_fp - 16];
 
-       mono_handle_exception (&mctx, obj, mctx.ip, test_only);
+       mono_handle_exception (&mctx, obj);
 
 #ifdef SPARCV9
        sc->sigc_regs.tpc = (unsigned long) mctx.ip;
@@ -450,7 +443,7 @@ mono_arch_ip_from_context (void *sigctx)
 #else /* !__linux__ */
 
 gboolean
-mono_arch_handle_exception (void *sigctx, gpointer obj, gboolean test_only)
+mono_arch_handle_exception (void *sigctx, gpointer obj)
 {
        MonoContext mctx;
        ucontext_t *ctx = (ucontext_t*)sigctx;
@@ -468,7 +461,7 @@ mono_arch_handle_exception (void *sigctx, gpointer obj, gboolean test_only)
        window = (gpointer*)(((guint8*)mctx.sp) + MONO_SPARC_STACK_BIAS);
        mctx.fp = window [sparc_fp - 16];
 
-       mono_handle_exception (&mctx, obj, mctx.ip, test_only);
+       mono_handle_exception (&mctx, obj);
        
        /* We can't use restore_context to return from a signal handler */
        ctx->uc_mcontext.gregs [REG_PC] = mctx.ip;