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]

Handle SIGINT in Python


Hi,

I've written a patch to GDB's Python support to allow SIGINT to interrupt a running script to address the bug http://sourceware.org/bugzilla/show_bug.cgi?id=13265 (I've attached my patch to that page).

It works by installing a Python-specific SIGINT handler just before executing a Python script, and restoring the original SIGINT handler after execution as well as at calls to gdb.execute(...).

There's one caveat: if an inferior is running via, e.g., gdb.execute("run"), SIGINT will interrupt the inferior but not the enclosing "python" command. I think it would be better to also interrupt the "python" command, but I'm not sure how to detect this case yet.

Yit
January 10, 2012


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