Consolidate some Python exception-printing functions
authorTom Tromey <tom@tromey.com>
Tue, 25 Dec 2018 18:44:58 +0000 (11:44 -0700)
committerTom Tromey <tom@tromey.com>
Thu, 27 Dec 2018 20:34:39 +0000 (13:34 -0700)
commit6ef2312a177ebdfa841e82b515c144975073a501
treeba1050399bcbfe2ac09c66ed5670c97a58abe43e
parentec9c2750b7bab8a55aaf7d2386e809d4e81deb03
Consolidate some Python exception-printing functions

A few places in the Python code would either call gdbpy_print_stack,
or throw a gdb "quit", depending on the pending exception.  This patch
consolidates these into a helper function.

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

* python/python-internal.h (gdbpy_print_stack_or_quit): Declare.
* python/py-unwind.c (pyuw_sniffer): Use
gdbpy_print_stack_or_quit.
* python/py-framefilter.c (throw_quit_or_print_exception):
Remove.
(gdbpy_apply_frame_filter): Use gdbpy_print_stack_or_quit.
* python/python.c (gdbpy_print_stack_or_quit): New function.
gdb/ChangeLog
gdb/python/py-framefilter.c
gdb/python/py-unwind.c
gdb/python/python-internal.h
gdb/python/python.c