This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]