binutils-gdb/gdb/python
Tom Tromey bc543c902f Translate PyExc_KeyboardInterrupt to gdb "quit"
A while back I typed "info pretty-printers" with a large number of
printers installed, and I typed "q" to stop the pagination.  I noticed
that gdb printed a Python exception in this case.

It seems to me that, instead, quitting pagination (or control-c'ing a
Python command generally) should be handled the same way that gdb
normally handles a quit.

This patch implements this idea by changing gdbpy_handle_exception to
treat PyExc_KeyboardInterrupt specially.

gdb/ChangeLog
2018-12-27  Tom Tromey  <tom@tromey.com>

	* python/py-utils.c (gdbpy_handle_exception): Translate
	PyExc_KeyboardInterrupt to quit.

gdb/testsuite/ChangeLog
2018-12-27  Tom Tromey  <tom@tromey.com>

	* gdb.python/py-cmd.exp (test_python_inline_or_multiline): Add
	pagination test.
2018-12-27 13:34:39 -07:00
..
lib/gdb
py-all-events.def
py-arch.c
py-auto-load.c
py-block.c
py-bpevent.c
py-breakpoint.c Use gdbpy_convert_exception in a few more spots 2018-12-27 13:34:38 -07:00
py-cmd.c Use gdbpy_convert_exception in a few more spots 2018-12-27 13:34:38 -07:00
py-continueevent.c
py-event-types.def
py-event.c
py-event.h
py-events.h
py-evtregistry.c
py-evts.c
py-exitedevent.c
py-finishbreakpoint.c
py-frame.c
py-framefilter.c Consolidate some Python exception-printing functions 2018-12-27 13:34:39 -07:00
py-function.c
py-gdb-readline.c
py-inferior.c Remove more calls to xfree from Python 2018-12-27 10:50:43 -07:00
py-infevents.c
py-infthread.c
py-instruction.c
py-instruction.h
py-lazy-string.c
py-linetable.c
py-newobjfileevent.c
py-objfile.c Remove more calls to xfree from Python 2018-12-27 10:50:43 -07:00
py-param.c Use gdbpy_convert_exception in a few more spots 2018-12-27 13:34:38 -07:00
py-prettyprint.c
py-progspace.c
py-record-btrace.c Remove more calls to xfree from Python 2018-12-27 10:50:43 -07:00
py-record-btrace.h
py-record-full.c
py-record-full.h
py-record.c
py-record.h
py-ref.h
py-signalevent.c
py-stopevent.c
py-stopevent.h
py-symbol.c
py-symtab.c Remove more calls to xfree from Python 2018-12-27 10:50:43 -07:00
py-threadevent.c
py-type.c
py-unwind.c Consolidate some Python exception-printing functions 2018-12-27 13:34:39 -07:00
py-utils.c Translate PyExc_KeyboardInterrupt to gdb "quit" 2018-12-27 13:34:39 -07:00
py-value.c Use gdbpy_convert_exception in a few more spots 2018-12-27 13:34:38 -07:00
py-varobj.c
py-xmethods.c
python-config.py
python-internal.h Consolidate some Python exception-printing functions 2018-12-27 13:34:39 -07:00
python.c Consolidate some Python exception-printing functions 2018-12-27 13:34:39 -07:00
python.h