[PING][PATCH] Python: Fix Python error when "Quit"ting a paged info pretty-printers

Pedro Alves palves@redhat.com
Tue Mar 15 17:51:00 GMT 2016


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



More information about the Gdb-patches mailing list