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: Tom Tromey <tom at tromey dot com>
- To: Leonardo Boquillon <leonardo dot boquillon at tallertechnologies dot com>
- Cc: gdb-patches at sourceware dot org, tom at tromey dot com
- Date: Tue, 15 Mar 2016 11:20:34 -0600
- 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>
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.
There's a general "exception denaturation" problem in the python layer
-- that is, important information about exceptions can be lost in the
translation from gdb to python and back. See
https://sourceware.org/bugzilla/show_bug.cgi?id=12174, though IIRC this
bug only covers one direction, while both directions matter.
Tom