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: Handle SIGINT in Python


>>>>> "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


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