+2018-12-27 Tom Tromey <tom@tromey.com>
+
+ * python/py-utils.c (gdbpy_handle_exception): Translate
+ PyExc_KeyboardInterrupt to quit.
+
2018-12-27 Tom Tromey <tom@tromey.com>
* python/python-internal.h (gdbpy_print_stack_or_quit): Declare.
for user errors. However, a missing message for gdb.GdbError
exceptions is arguably a bug, so we flag it as such. */
- if (! PyErr_GivenExceptionMatches (ptype, gdbpy_gdberror_exc)
+ if (PyErr_GivenExceptionMatches (ptype, PyExc_KeyboardInterrupt))
+ throw_quit ("Quit");
+ else if (! PyErr_GivenExceptionMatches (ptype, gdbpy_gdberror_exc)
|| msg == NULL || *msg == '\0')
{
PyErr_Restore (ptype, pvalue, ptraceback);
+2018-12-27 Tom Tromey <tom@tromey.com>
+
+ * gdb.python/py-cmd.exp (test_python_inline_or_multiline): Add
+ pagination test.
+
2018-12-24 Andrew Burgess <andrew.burgess@embecosm.com>
* gdb.dwarf2/dw2-unusual-field-names.c: New file.
}
}
}
+
+
+# Test that interrupting pagination throws a gdb quit.
+gdb_test_no_output "set height 10"
+
+gdb_py_test_multiple "input multi-line-output command" \
+ "python" "" \
+ "class test_mline (gdb.Command):" "" \
+ " \"\"\"Docstring\"\"\"" "" \
+ " def __init__ (self):" "" \
+ " super (test_mline, self).__init__ (\"test_multiline\", gdb.COMMAND_USER)" "" \
+ " def invoke (self, arg, from_tty):" "" \
+ " for f in range(20):" "" \
+ " print (\"test_multiline output\")" "" \
+ "test_mline ()" "" \
+ "end" ""
+
+set test "verify pagination from test_multiline"
+gdb_test_multiple "test_multiline" $test {
+ -re "--Type <RET>" {
+ exp_continue
+ }
+ -re " for more, q to quit" {
+ exp_continue
+ }
+ -re ", c to continue without paging--$" {
+ pass $test
+ }
+}
+
+send_gdb "q\n"
+set test "verify pagination from test_multiline: q"
+gdb_test_multiple "test_multiline" $test {
+ -re "Error occurred in Python" {
+ fail $test
+ }
+ -re "Quit" {
+ pass $test
+ }
+}