Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Leonardo Boquillon <leonardo.boquillon@tallertechnologies.com>
Cc: gdb-patches@sourceware.org,  tom@tromey.com
Subject: Re: [PING][PATCH] Python: Fix Python error when "Quit"ting a paged info pretty-printers
Date: Tue, 15 Mar 2016 17:20:00 -0000	[thread overview]
Message-ID: <87bn6flkt9.fsf@tromey.com> (raw)
In-Reply-To: <1458046365-21110-1-git-send-email-leonardo.boquillon@tallertechnologies.com>	(Leonardo Boquillon's message of "Tue, 15 Mar 2016 09:52:45 -0300")

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


  parent reply	other threads:[~2016-03-15 17:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-15 12:53 Leonardo Boquillon
2016-03-15 15:45 ` Pedro Alves
2016-03-15 17:20 ` Tom Tromey [this message]
2016-03-15 17:51   ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bn6flkt9.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=leonardo.boquillon@tallertechnologies.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox