runtime: Don't block SIGTRAP while creating a new thread.
authorIan Lance Taylor <ian@gcc.gnu.org>
Thu, 28 Feb 2013 21:56:14 +0000 (21:56 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Thu, 28 Feb 2013 21:56:14 +0000 (21:56 +0000)
Thanks to Uros Bizjak.

From-SVN: r196362

libgo/runtime/proc.c

index b59f4acf0dc10b18b6699cf6e860da8a86196509..9b563a50946ce8599bc7f7a12ba73a0abcb49ef3 100644 (file)
@@ -1256,6 +1256,12 @@ runtime_newm(void)
        // Block signals during pthread_create so that the new thread
        // starts with signals disabled.  It will enable them in minit.
        sigfillset(&clear);
+
+#ifdef SIGTRAP
+       // Blocking SIGTRAP reportedly breaks gdb on Alpha GNU/Linux.
+       sigdelset(&clear, SIGTRAP);
+#endif
+
        sigemptyset(&old);
        sigprocmask(SIG_BLOCK, &clear, &old);
        ret = pthread_create(&tid, &attr, runtime_mstart, mp);