From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Doug Evans Newsgroups: gmane.comp.gdb.patches,gmane.lisp.guile.user Subject: Re: [PATCH v2 02/13] script language API for GDB: extension.[ch] Date: Tue, 24 Dec 2013 10:05:54 -0800 Message-ID: References: <52a7f3e8.e7ed440a.1c58.020f@mx.google.com> <87vbyffcwu.fsf@fleche.redhat.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1387908357 13641 80.91.229.3 (24 Dec 2013 18:05:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 24 Dec 2013 18:05:57 +0000 (UTC) Cc: "gdb-patches@sourceware.org" , guile-user@gnu.org To: Tom Tromey Original-X-From: gdb-patches-return-108701-gdb-gdb-patches=m.gmane.org@sourceware.org Tue Dec 24 19:06:04 2013 Return-path: Envelope-to: gdb-gdb-patches@plane.gmane.org Original-Received: from server1.sourceware.org ([209.132.180.131] helo=sourceware.org) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VvWMl-0005zV-Cb for gdb-gdb-patches@plane.gmane.org; Tue, 24 Dec 2013 19:06:03 +0100 DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; q=dns; s=default; b= gQ1j7GRzZvp2fvhkFU1c/RinOi/NW255SsAE/RRf7U/Xs0Fz1G/Jc33/easq0hhr NbJLycaGbXssaRIdMbhHNeS3LTno8atC0ndMAbCg/HlfKSfxN+3t1Qmphi2ISFLv j8socMb4AiGXdHOY+5qFz4WHcF/qadOoK/w+2WAdkoo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; s=default; bh=oa64A O6wR2Zkisiz7nw1SEORgQk=; b=hF7NSEa3Qyn3hc8fLYFZlaBSbATzmHtFGbd7T YrS3YI20m5sGqdXrZe8ksNZdBlnRFmGtC/aZ5QjNsyZLzrkWf9d3mUVUS81ViSD6 9EVsBEQiSAfFoVGjzJlra2x4ioxR49Y9v+M3cmGvnktLXD3a5AuffP9dVMCy2t+x pjtPdA= Original-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-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Original-Sender: gdb-patches-owner@sourceware.org Original-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 Original-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 Original-Received: by mail-wg0-f41.google.com with SMTP id y10so10294230wgg.0 for ; Tue, 24 Dec 2013 10:05:54 -0800 (PST) X-Received: by 10.194.48.74 with SMTP id j10mr16712632wjn.41.1387908354093; Tue, 24 Dec 2013 10:05:54 -0800 (PST) Original-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> X-IsSubscribed: yes Xref: news.gmane.org gmane.comp.gdb.patches:93703 gmane.lisp.guile.user:10942 Archived-At: [+ 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.