guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 02/13] script language API for GDB: extension.[ch]


From: Tom Tromey
Subject: Re: [PATCH v2 02/13] script language API for GDB: extension.[ch]
Date: Tue, 07 Jan 2014 09:02:59 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

>>>>> "Ludovic" == Ludovic Courtès <address@hidden> writes:

Ludovic> So do I get it right that it’s GDB that does signal(SIGINT, ...), and
Ludovic> its handler just calls PyOS_InterruptOccurred (or so) if Python code
Ludovic> happens to be running?

Yeah.

>> One approach for multiple extension languages might be to notice when
>> switching languages and move the bit.  However I didn't see any way to
>> do this in the Guile API.  In Python it can be accomplished with
>> PyErr_SetInterrupt and PyOS_InterruptOccurred.

Ludovic> Would it work, upon SIGINT, to do something like:
Ludovic>   (system-async-mark (lambda ()
Ludovic>                        (throw 'system-error ... EINTR)))
Ludovic> That would eventually raise an exception in Scheme code.

According to the Guile docs one must use scm_sigaction, since
scm_system_async_mark is not async-signal-safe.

However scm_sigaction takes over the signal.  I don't think that will
work ok.  Also this idea doesn't address how it would interact with the
gdb core or with Python.

Tom



reply via email to

[Prev in Thread] Current Thread [Next in Thread]