public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* Handle SIGINT in Python
@ 2012-01-10 21:31 Khoo Yit Phang
  2012-01-10 21:47 ` Doug Evans
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Khoo Yit Phang @ 2012-01-10 21:31 UTC (permalink / raw)
  To: gdb-patches; +Cc: Khoo Yit Phang

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

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2012-01-22 16:57 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-10 21:31 Handle SIGINT in Python Khoo Yit Phang
2012-01-10 21:47 ` Doug Evans
2012-01-10 22:09   ` Khoo Yit Phang
2012-01-11 20:59   ` Tom Tromey
2012-01-11 21:06     ` Paul_Koning
2012-01-11 21:23       ` Tom Tromey
2012-01-12  0:54     ` Doug Evans
2012-01-12 15:52       ` Kevin Pouget
2012-01-12 16:48         ` Paul_Koning
2012-01-13 10:55           ` Kevin Pouget
2012-01-13 12:11             ` Paul_Koning
2012-01-10 21:49 ` Tom Tromey
2012-01-11 21:15 ` Tom Tromey
2012-01-11 21:49   ` Khoo Yit Phang
2012-01-11 22:46     ` Khoo Yit Phang
2012-01-20 21:40     ` Tom Tromey
2012-01-22 16:36       ` Khoo Yit Phang
2012-01-22 20:54         ` Khoo Yit Phang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).