From: Khoo Yit Phang <khooyp@cs.umd.edu>
To: gdb-patches@sourceware.org
Cc: Khoo Yit Phang <khooyp@cs.umd.edu>
Subject: Handle SIGINT in Python
Date: Tue, 10 Jan 2012 21:31:00 -0000 [thread overview]
Message-ID: <A8DAE02C-D489-4C5A-A4C5-6D898A0D8A9F@cs.umd.edu> (raw)
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
next reply other threads:[~2012-01-10 21:29 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-10 21:31 Khoo Yit Phang [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=A8DAE02C-D489-4C5A-A4C5-6D898A0D8A9F@cs.umd.edu \
--to=khooyp@cs.umd.edu \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox