From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 62441 invoked by alias); 15 Mar 2016 17:20:46 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 62419 invoked by uid 89); 15 Mar 2016 17:20:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1023, H*F:U*tom X-HELO: gproxy1-pub.mail.unifiedlayer.com Received: from gproxy1-pub.mail.unifiedlayer.com (HELO gproxy1-pub.mail.unifiedlayer.com) (69.89.25.95) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with SMTP; Tue, 15 Mar 2016 17:20:44 +0000 Received: (qmail 30543 invoked by uid 0); 15 Mar 2016 17:20:42 -0000 Received: from unknown (HELO cmgw4) (10.0.90.85) by gproxy1.mail.unifiedlayer.com with SMTP; 15 Mar 2016 17:20:42 -0000 Received: from box522.bluehost.com ([74.220.219.122]) by cmgw4 with id WHLe1s00A2f2jeq01HLhva; Tue, 15 Mar 2016 11:20:42 -0600 X-Authority-Analysis: v=2.1 cv=aJ5j99Nm c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=PnD2wP_eR3oA:10 a=mELL_zmI2BgA:10 a=7OsogOcEt9IA:10 a=CCpqsmhAAAAA:8 a=0m9cpztPMLOr4rwE0CcA:9 Received: from [71.33.150.164] (port=53548 helo=pokyo) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.86_2) (envelope-from ) id 1afse5-0006E5-R4; Tue, 15 Mar 2016 11:20:38 -0600 From: Tom Tromey To: Leonardo Boquillon Cc: gdb-patches@sourceware.org, tom@tromey.com Subject: Re: [PING][PATCH] Python: Fix Python error when "Quit"ting a paged info pretty-printers References: <1458046365-21110-1-git-send-email-leonardo.boquillon@tallertechnologies.com> Date: Tue, 15 Mar 2016 17:20:00 -0000 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") Message-ID: <87bn6flkt9.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Identified-User: {36111:box522.bluehost.com:elynrobi:tromey.com} {sentby:smtp auth 71.33.150.164 authed with tom+tromey.com} X-SW-Source: 2016-03/txt/msg00240.txt.bz2 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