unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Doug Evans <xdje42@gmail.com>
To: Tom Tromey <tromey@redhat.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
	guile-user@gnu.org
Subject: Re: [PATCH v2 02/13] script language API for GDB: extension.[ch]
Date: Tue, 24 Dec 2013 10:05:54 -0800	[thread overview]
Message-ID: <CAP9bCMQx_pDKsRTDv5h62kqO4==MTJ80XsZ2RYfpzsjDT1u68g@mail.gmail.com> (raw)
In-Reply-To: <87vbyffcwu.fsf@fleche.redhat.com>

[+ guile-user, in case they have any thoughts on Guile SIGINT handling]

On Mon, Dec 23, 2013 at 1:57 PM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Doug" == Doug Evans <xdje42@gmail.com> 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.


       reply	other threads:[~2013-12-24 18:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <52a7f3e8.e7ed440a.1c58.020f@mx.google.com>
     [not found] ` <87vbyffcwu.fsf@fleche.redhat.com>
2013-12-24 18:05   ` Doug Evans [this message]
2014-01-03 21:10     ` [PATCH v2 02/13] script language API for GDB: extension.[ch] Ludovic Courtès
2014-01-06 21:53       ` Tom Tromey
2014-01-07 13:10         ` Ludovic Courtès
2014-01-07 16:02           ` Tom Tromey
2014-01-07 23:05             ` Ludovic Courtès
2014-01-08  3:17               ` Tom Tromey
2014-01-14 19:17               ` Tom Tromey
2014-01-15 14:52                 ` Ludovic Courtès
2014-01-22  4:21                 ` Mark H Weaver
2014-01-22  4:35                   ` Doug Evans

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAP9bCMQx_pDKsRTDv5h62kqO4==MTJ80XsZ2RYfpzsjDT1u68g@mail.gmail.com' \
    --to=xdje42@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=guile-user@gnu.org \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).