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:

Tom> Could we possibly solve this problem without constantly resetting the
Tom> SIGINT handler?  Maybe via a combination of a global flag plus a call
Tom> into Python from handle_sigint?

Yit> It is possible, I just need a way to call PySet_Interrupt. But it
Yit> seems to be that it would require adding hooks to events-top.c and,
Yit> which seems like a separate project.

I think of it more as a different implementation of the feature...

Tom> Our python->gdb exception story is not super.  And, we lose information
Tom> in the round trip.  This might (or might not...) be a prerequisite to
Tom> solving this problem.

Yit> I don't think it's a problem, unless for nested calls to python like
Yit> "py gdb.execute('py ...')".

You can't fully predict what gdb actions will cause Python code to run.

Also, Python frequently calls into gdb.  Any place in gdb that invokes
QUIT could potentially see a C-c.  However, IIUC, with your patch these
QUITs will be inactive if there is Python code up the stack -- but this
means that some slow things in gdb will be uninterruptible.

Tom


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