Add more debug output to sdb to debug suspend issues.
authorZoltan Varga <vargaz@gmail.com>
Fri, 14 Sep 2012 15:23:25 +0000 (17:23 +0200)
committerZoltan Varga <vargaz@gmail.com>
Fri, 14 Sep 2012 15:23:41 +0000 (17:23 +0200)
mono/mini/debugger-agent.c
mono/mini/mini-posix.c

index 0b311dd5d6448ee343111f8aaf93e1233eb87ce7..b5d3484cdeafcb1244cd7ff9ecc2662c7380efe1 100644 (file)
@@ -2452,8 +2452,10 @@ mono_debugger_agent_thread_interrupt (void *sigctx, MonoJitInfo *ji)
                return FALSE;
 
        tls = mono_native_tls_get_value (debugger_tls_id);
-       if (!tls)
-               return FALSE;
+       if (!tls) {
+               DEBUG (1, fprintf (log_file, "[%p] Received interrupt with no TLS, continuing.\n", (gpointer)GetCurrentThreadId ()));
+               return FALSE;
+       }
 
        return thread_interrupt (tls, NULL, sigctx, ji);
 }
@@ -2542,11 +2544,13 @@ notify_thread (gpointer key, gpointer value, gpointer user_data)
                mono_thread_info_resume (mono_thread_info_get_tid (info));
        } else {
                res = mono_thread_kill (thread, mono_thread_get_abort_signal ());
-               if (res)
+               if (res) {
+                       DEBUG(1, fprintf (log_file, "[%p] mono_thread_kill () failed for %p: %d...\n", (gpointer)GetCurrentThreadId (), (gpointer)tid, res));
                        /* 
                         * Attached thread which died without detaching.
                         */
                        tls->terminated = TRUE;
+               }
        }
 #endif
 }
index 605a1ff088f80942d573dddded5c4ab02ae4dbd1..d03e1147d4fbe22ac33732640d42cca4637fc6cb 100644 (file)
@@ -208,10 +208,12 @@ SIG_HANDLER_SIGNATURE (sigusr1_signal_handler)
        
        GET_CONTEXT;
 
-       if (!thread || !domain)
+       if (!thread || !domain) {
                /* The thread might not have started up yet */
                /* FIXME: Specify the synchronization with start_wrapper () in threads.c */
+               mono_debugger_agent_thread_interrupt (ctx, NULL);
                return;
+       }
 
        if (thread->ignore_next_signal) {
                thread->ignore_next_signal = FALSE;