diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b55ffdd89fc..ab329dfd5df 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2017-11-16 Pedro Alves + + * python/py-unwind.c (pyuw_sniffer): Translate + PyExc_KeyboardInterrupt to a GDB Quit exception. + 2017-11-16 Pedro Alves * infrun.c (resume_cleanups): Delete. diff --git a/gdb/python/py-unwind.c b/gdb/python/py-unwind.c index acfce7d96c1..b5783732657 100644 --- a/gdb/python/py-unwind.c +++ b/gdb/python/py-unwind.c @@ -539,6 +539,13 @@ pyuw_sniffer (const struct frame_unwind *self, struct frame_info *this_frame, pyo_pending_frame.get (), NULL)); if (pyo_unwind_info == NULL) { + /* If the unwinder is cancelled due to a Ctrl-C, then propagate + the Ctrl-C as a GDB exception instead of swallowing it. */ + if (PyErr_ExceptionMatches (PyExc_KeyboardInterrupt)) + { + PyErr_Clear (); + quit (); + } gdbpy_print_stack (); return 0; }