From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26584 invoked by alias); 20 Jan 2012 21:34:06 -0000 Received: (qmail 26394 invoked by uid 22791); 20 Jan 2012 21:34:06 -0000 X-SWARE-Spam-Status: No, hits=-7.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 20 Jan 2012 21:33:53 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q0KLXpj4008532 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 20 Jan 2012 16:33:51 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q0KLXp5j000869; Fri, 20 Jan 2012 16:33:51 -0500 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id q0KLXn5h019220; Fri, 20 Jan 2012 16:33:50 -0500 From: Tom Tromey To: Khoo Yit Phang Cc: gdb-patches@sourceware.org Subject: Re: Handle SIGINT in Python References: <1FE2845A-162C-48D7-A3D0-C0F2D6DFA09B@cs.umd.edu> Date: Fri, 20 Jan 2012 21:40:00 -0000 In-Reply-To: <1FE2845A-162C-48D7-A3D0-C0F2D6DFA09B@cs.umd.edu> (Khoo Yit Phang's message of "Wed, 11 Jan 2012 16:45:52 -0500") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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 X-SW-Source: 2012-01/txt/msg00751.txt.bz2 >>>>> "Yit" == Khoo Yit Phang writes: Tom> Could we possibly solve this problem without constantly resetting the Tom> SIGINT handler? Maybe via a combination of a global flag plus a call Tom> into Python from handle_sigint? Yit> It is possible, I just need a way to call PySet_Interrupt. But it Yit> seems to be that it would require adding hooks to events-top.c and, Yit> which seems like a separate project. I think of it more as a different implementation of the feature... Tom> Our python->gdb exception story is not super. And, we lose information Tom> in the round trip. This might (or might not...) be a prerequisite to Tom> solving this problem. Yit> I don't think it's a problem, unless for nested calls to python like Yit> "py gdb.execute('py ...')". You can't fully predict what gdb actions will cause Python code to run. Also, Python frequently calls into gdb. Any place in gdb that invokes QUIT could potentially see a C-c. However, IIUC, with your patch these QUITs will be inactive if there is Python code up the stack -- but this means that some slow things in gdb will be uninterruptible. Tom