diff options
Diffstat (limited to 'gdb/python/python.c')
-rw-r--r-- | gdb/python/python.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gdb/python/python.c b/gdb/python/python.c index f790d48..3d0b0a0 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -1268,6 +1268,20 @@ gdbpy_print_stack (void) } } +/* Like gdbpy_print_stack, but if the exception is a + KeyboardException, throw a gdb "quit" instead. */ + +void +gdbpy_print_stack_or_quit () +{ + if (PyErr_ExceptionMatches (PyExc_KeyboardInterrupt)) + { + PyErr_Clear (); + throw_quit ("Quit"); + } + gdbpy_print_stack (); +} + /* Return a sequence holding all the Progspaces. */ |