[Bug python/14291] New: python KeyboardInterrupt not caught
eager at eagercon dot com
sourceware-bugzilla@sourceware.org
Mon Jun 25 12:12:00 GMT 2012
http://sourceware.org/bugzilla/show_bug.cgi?id=14291
Bug #: 14291
Summary: python KeyboardInterrupt not caught
Product: gdb
Version: HEAD
Status: NEW
Severity: normal
Priority: P2
Component: python
AssignedTo: unassigned@sourceware.org
ReportedBy: eager@eagercon.com
Classification: Unclassified
Created attachment 6478
--> http://sourceware.org/bugzilla/attachment.cgi?id=6478
Patch to test for KeyboardInterrupt
GDB does not pass the KeyboardInterrupt exception to Python when the user
terminates paged terminal output generated by Python. This causes Python
scripts to terminate when the user interrupts output.
(gdb) set height 5
(gdb) python
>try:
> for i in range(400):
> print i
>except KeyboardInterrupt:
> print "caught interrupt"
>end
0
1
2
3
---Type <return> to continue, or q <return> to quit---q
Quit
When the output is generated by a GDB command, the exception is caught and
passed to Python.
(gdb) python
>try:
> gdb.execute("help all")
>except KeyboardInterrupt:
> print "caught interrupt"
>end
Command class: aliases
ni -- Step one instruction
---Type <return> to continue, or q <return> to quit---q
caught interrupt
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the Gdb-prs
mailing list