This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PING][PATCH] Python: Fix Python error when "Quit"ting a paged info pretty-printers
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tom at tromey dot com>, Leonardo Boquillon <leonardo dot boquillon at tallertechnologies dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 15 Mar 2016 17:51:03 +0000
- Subject: Re: [PING][PATCH] Python: Fix Python error when "Quit"ting a paged info pretty-printers
- Authentication-results: sourceware.org; auth=none
- References: <1458046365-21110-1-git-send-email-leonardo dot boquillon at tallertechnologies dot com> <87bn6flkt9 dot fsf at tromey dot com>
On 03/15/2016 05:20 PM, Tom Tromey wrote:
> Leonardo> Right now the "Quit" command used in the output paging is
> Leonardo> handled as an exception. If we issue a "Quit" while
> Leonardo> outputting the registered pretty-printers list, the Python
> Leonardo> handling layer will catch it and think it's a Python error.
>
> Leonardo> The fix is to check if the error coming from Python is a Quit
> Leonardo> signal. If it is, do not handle it as an error and resume the
> Leonardo> execution normally.
>
> I think a quit should be turned into a PyExc_KeyboardInterrupt. So it
> would make sense, IMO, to turn a PyExc_KeyboardInterrupt back into a
> RETURN_QUIT in py-cmd.c.
That makes sense to me. We already do something like that, in
set_active_ext_lang / restore_active_ext_lang, actually.
(
I happen to be working on getting rid of immediate_quit, for
C++ conversion, and a good part of that is about not losing
Ctrl-C's, ever, so that feels quite apropos:
https://github.com/palves/gdb/commits/palves/immediate_quit
)
Thanks,
Pedro Alves