From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24471 invoked by alias); 24 Dec 2013 18:05:59 -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 24380 invoked by uid 89); 24 Dec 2013 18:05:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 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-wg0-f41.google.com Received: from mail-wg0-f41.google.com (HELO mail-wg0-f41.google.com) (74.125.82.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 24 Dec 2013 18:05:57 +0000 Received: by mail-wg0-f41.google.com with SMTP id y10so10294230wgg.0 for ; Tue, 24 Dec 2013 10:05:54 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.194.48.74 with SMTP id j10mr16712632wjn.41.1387908354093; Tue, 24 Dec 2013 10:05:54 -0800 (PST) Received: by 10.194.123.4 with HTTP; Tue, 24 Dec 2013 10:05:54 -0800 (PST) In-Reply-To: <87vbyffcwu.fsf@fleche.redhat.com> References: <52a7f3e8.e7ed440a.1c58.020f@mx.google.com> <87vbyffcwu.fsf@fleche.redhat.com> Date: Tue, 24 Dec 2013 18:05:00 -0000 Message-ID: Subject: Re: [PATCH v2 02/13] script language API for GDB: extension.[ch] From: Doug Evans To: Tom Tromey Cc: "gdb-patches@sourceware.org" , guile-user@gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2013-12/txt/msg00905.txt.bz2 [+ guile-user, in case they have any thoughts on Guile SIGINT handling] On Mon, Dec 23, 2013 at 1:57 PM, Tom Tromey wrote: >>>>>> "Doug" == Doug Evans writes: > > Doug> +void > Doug> +clear_quit_flag (void) > Doug> +{ > Doug> + int i; > Doug> + const struct extension_language_defn *extlang; > Doug> + > Doug> + ALL_ENABLED_EXTENSION_LANGUAGES (i, extlang) > Doug> + { > Doug> + if (extlang->ops->clear_quit_flag != NULL) > Doug> + extlang->ops->clear_quit_flag (extlang); > Doug> + } > Doug> + > Doug> + quit_flag = 0; > Doug> +} > > I don't think this will work properly. It seems to me that a given > interrupt may be processed multiple times -- once by each extension > language. Guile doesn't provide the same hooks that Python does for SIGINT (PyErr_SetInterrupt, et.al.) so I expect this part to need some work. > The way it works right now, if Python handles the "quit", then Python > clears the flag -- which also clears gdb's notion of the flag, because > the two are identical. > > With the above it seems that Python could clear its flag -- but leave > other extension languages unaware that the interrupt was handled. So, a > subsequent call into Guile will presumably erroneously throw an > exception. We carefully manage entry and exit to/from extension languages. It should be possible to manage SIGINT across these boundaries. v3 coming up, but I'm leaving this part to v4.