This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


>>>>> "Ludovic" == Ludovic CourtÃs <ludo@gnu.org> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]