Created attachment 6478 [details] 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
FWIW this patch looks reasonable. Please send it to gdb-patches.
Applied some time ago, IIRC. On 08/03/2012 10:57 AM, tromey at redhat dot com wrote: > http://sourceware.org/bugzilla/show_bug.cgi?id=14291 > > Tom Tromey <tromey at redhat dot com> changed: > > What |Removed |Added > ---------------------------------------------------------------------------- > CC| |tromey at redhat dot com > > --- Comment #1 from Tom Tromey <tromey at redhat dot com> 2012-08-03 17:57:36 UTC --- > FWIW this patch looks reasonable. > Please send it to gdb-patches. >
(In reply to comment #2) > Applied some time ago, IIRC. Indeed it was. Thanks.