From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22909 invoked by alias); 18 Feb 2014 00:37:34 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 22899 invoked by uid 89); 18 Feb 2014 00:37:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-yk0-f169.google.com Received: from mail-yk0-f169.google.com (HELO mail-yk0-f169.google.com) (209.85.160.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 18 Feb 2014 00:37:33 +0000 Received: by mail-yk0-f169.google.com with SMTP id 142so31519876ykq.0 for ; Mon, 17 Feb 2014 16:37:31 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.236.99.38 with SMTP id w26mr15381954yhf.18.1392683850899; Mon, 17 Feb 2014 16:37:30 -0800 (PST) Received: by 10.170.130.14 with HTTP; Mon, 17 Feb 2014 16:37:30 -0800 (PST) In-Reply-To: <83y519788a.fsf@gnu.org> References: <834n3x8o7m.fsf@gnu.org> <83y519788a.fsf@gnu.org> Date: Tue, 18 Feb 2014 00:37:00 -0000 Message-ID: Subject: Re: [PATCH v2] Improved ^c support for gdb/guile From: Doug Evans To: Eli Zaretskii Cc: "gdb-patches@sourceware.org" , guile-devel@gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2014-02/txt/msg00555.txt.bz2 On Mon, Feb 17, 2014 at 1:13 PM, Eli Zaretskii wrote: >> Date: Mon, 17 Feb 2014 12:59:22 -0800 >> From: Doug Evans >> Cc: "gdb-patches@sourceware.org" , guile-devel@gnu.org >> >> >> +void >> >> +gdbscm_initialize_sigint (void) >> >> +{ >> >> + siscm_sigint_pipe[0] = siscm_sigint_pipe[1] = -1; >> >> + >> >> + if (!SCM_USE_PTHREAD_THREADS) >> >> + { >> >> + warning (_("Guile does not have pthreads support.")); >> >> + warning (_("Proper SIGINT handling for Guile will be unavailable.")); >> >> + return; >> >> + } >> > >> > The above is what worries me. Guile currently doesn't work in the >> > native MinGW build if configured with threads (it crashes, hangs, >> > etc.). Can't we have decent SIGINT handling without pthreads? >> >> With 2.0.x, no. >> I'm ok with changing the warning, e.g., not printing it at all on >> systems where it would otherwise always be printed, and instead >> documenting the issue for such systems. >> >> The downside is that while Scheme code is running SIGINT is ignored >> (unless one is in the repl, or sets up a SIGINT handler oneself). > > Ignored why? because GDB sets the handler to SIG_IGN? Or for some > other reason? A better way to phrase that is the SIGINT is deferred until the call out to Guile returns. Why? Because Guile's SIGINT handling in 2.0.x requires a separate thread: that's how all async signals are handled in Guile. ref: guile-2.0.9/libguile/scmsigs.c I'll let guile-devel take over at this point - I understand the code, but may miss something noteworthy. There is code in scmsigs.c to handle the non-pthread case but it's not clear how much is exported nor how well it works.