This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Handle SIGINT in Python
- From: Tom Tromey <tromey at redhat dot com>
- To: Khoo Yit Phang <khooyp at cs dot umd dot edu>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 11 Jan 2012 14:06:04 -0700
- Subject: Re: Handle SIGINT in Python
- References: <A8DAE02C-D489-4C5A-A4C5-6D898A0D8A9F@cs.umd.edu>
>>>>> "Yit" == Khoo Yit Phang <khooyp@cs.umd.edu> writes:
Yit> I've written a patch to GDB's Python support to allow SIGINT to
Yit> interrupt a running script to address the bug
Yit> http://sourceware.org/bugzilla/show_bug.cgi?id=13265 (I've attached my
Yit> patch to that page).
See my other note about how to send the patch; and my other other note
about copyright assignments.
I don't understand why this code doesn't just pass the old signal
handler as an argument to the cleanup function. I think that would be
more readable.
What happens when the Python code calls back into gdb?
We do this in many places in gdb/python/*.c.
It seems to me that you'd have to temporarily push gdb's SIGINT handler
again.
Could we possibly solve this problem without constantly resetting the
SIGINT handler? Maybe via a combination of a global flag plus a call
into Python from handle_sigint?
Our python->gdb exception story is not super. And, we lose information
in the round trip. This might (or might not...) be a prerequisite to
solving this problem.
Tom