This is the mail archive of the
mailing list for the GDB project.
Re: [PATCH v2 02/13] script language API for GDB: extension.[ch]
- From: Tom Tromey <tromey at redhat dot com>
- To: ludo at gnu dot org (Ludovic CourtÃs)
- Cc: gdb-patches at sourceware dot org, guile-user at gnu dot org
- Date: Tue, 07 Jan 2014 09:02:59 -0700
- Subject: Re: [PATCH v2 02/13] script language API for GDB: extension.[ch]
- Authentication-results: sourceware.org; auth=none
- References: <52a7f3e8 dot e7ed440a dot 1c58 dot 020f at mx dot google dot com> <87vbyffcwu dot fsf at fleche dot redhat dot com> <CAP9bCMQx_pDKsRTDv5h62kqO4==MTJ80XsZ2RYfpzsjDT1u68g at mail dot gmail dot com> <87txdklqk4 dot fsf at gnu dot org> <87r48kkc9g dot fsf at fleche dot redhat dot com> <87eh4krl81 dot fsf at gnu dot org>
>>>>> "Ludovic" == Ludovic CourtÃs <firstname.lastname@example.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?
>> 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.