- MonoDomain *domain = mono_domain_get ();
- MonoJitInfo *ji, rji;
- static int (*call_filter) (MonoContext *, gpointer, gpointer) = NULL;
- MonoJitTlsData *jit_tls = TlsGetValue (mono_jit_tls_id);
- MonoLMF *lmf = jit_tls->lmf;
- GList *trace_ips = NULL;
-
- g_assert (ctx != NULL);
- if (!obj) {
- MonoException *ex = mono_get_exception_null_reference ();
- ex->message = mono_string_new (domain,
- "Object reference not set to an instance of an object");
- obj = (MonoObject *)ex;
- }
-
- g_assert (mono_object_isinst (obj, mono_defaults.exception_class));
-
- if (!call_filter)
- call_filter = arch_get_call_filter ();
-
- g_assert (jit_tls->end_of_stack);
- g_assert (jit_tls->abort_func);
-
- if (!test_only) {
- MonoContext ctx_cp = *ctx;
- if (mono_jit_trace_calls)
- g_print ("EXCEPTION handling: %s\n", mono_object_class (obj)->name);
- if (!mono_arch_handle_exception (&ctx_cp, obj, TRUE)) {
- if (mono_break_on_exc) {
- if (mono_debug_format != MONO_DEBUG_FORMAT_NONE)
- mono_debug_make_symbols ();
- G_BREAKPOINT ();
- }
- mono_unhandled_exception (obj);
- }
- }
-
- while (1) {
- MonoContext new_ctx;
- char *trace = NULL;
-
- ji = mono_arch_find_jit_info (domain, jit_tls, &rji, ctx, &new_ctx,
- test_only ? &trace : NULL, &lmf, NULL, NULL);
- if (!ji) {
- g_warning ("Exception inside function without unwind info");
- g_assert_not_reached ();
- }
-
- if (ji != (gpointer)-1) {
-
- if (test_only && ji->method->wrapper_type != MONO_WRAPPER_RUNTIME_INVOKE) {
- char *tmp, *strace;
-
- trace_ips = g_list_append (trace_ips, MONO_CONTEXT_GET_IP (ctx));