Merge pull request #3025 from kumpera/mono_raise_exception_in_threads
[mono.git] / mono / mini / debugger-agent.c
index e5906b18d89aeee6d1819fd5a1693030d00b9ccd..b24853b0586836fc34b151e91751737d3fa3c283 100644 (file)
@@ -2678,7 +2678,7 @@ notify_thread (gpointer key, gpointer value, gpointer user_data)
 
        DEBUG_PRINTF (1, "[%p] Interrupting %p...\n", (gpointer) (gsize) mono_native_thread_id_get (), (gpointer)tid);
 
-       /* This is _not_ equivalent to ves_icall_System_Threading_Thread_Abort () */
+       /* This is _not_ equivalent to mono_thread_internal_abort () */
        InterruptData interrupt_data = { 0 };
        interrupt_data.tls = tls;
 
@@ -6802,7 +6802,7 @@ invoke_method (void)
        /*
         * Take the loader lock to avoid race conditions with CMD_VM_ABORT_INVOKE:
         *
-        * It is possible that ves_icall_System_Threading_Thread_Abort () was called
+        * It is possible that mono_thread_internal_abort () was called
         * after the mono_runtime_invoke_checked() already returned, but it doesn't matter
         * because we reset the abort here.
         */
@@ -7114,7 +7114,7 @@ vm_commands (int command, int id, guint8 *p, guint8 *end, Buffer *buf)
 
                tls->abort_requested = TRUE;
 
-               ves_icall_System_Threading_Thread_Abort (THREAD_TO_INTERNAL (thread), NULL);
+               mono_thread_internal_abort (THREAD_TO_INTERNAL (thread));
                mono_loader_unlock ();
                break;
        }
@@ -8666,11 +8666,12 @@ method_commands_internal (int command, MonoMethod *method, MonoDomain *domain, g
                // FIXME: Generics
                switch (mono_metadata_token_code (token)) {
                case MONO_TOKEN_STRING: {
+                       MonoError error;
                        MonoString *s;
                        char *s2;
 
-                       s = mono_ldstr (domain, method->klass->image, mono_metadata_token_index (token));
-                       g_assert (s);
+                       s = mono_ldstr_checked (domain, method->klass->image, mono_metadata_token_index (token), &error);
+                       mono_error_assert_ok (&error); /* FIXME don't swallow the error */
 
                        s2 = mono_string_to_utf8 (s);