From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20034 invoked by alias); 11 Jan 2012 21:06:32 -0000 Received: (qmail 19959 invoked by uid 22791); 11 Jan 2012 21:06:29 -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; Wed, 11 Jan 2012 21:06:07 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q0BL65wa003188 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 11 Jan 2012 16:06:05 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q0BL65Pj017289; Wed, 11 Jan 2012 16:06:05 -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 q0BL649w010706; Wed, 11 Jan 2012 16:06:04 -0500 From: Tom Tromey To: Khoo Yit Phang Cc: gdb-patches@sourceware.org Subject: Re: Handle SIGINT in Python References: Date: Wed, 11 Jan 2012 21:15:00 -0000 In-Reply-To: (Khoo Yit Phang's message of "Tue, 10 Jan 2012 16:29:16 -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/msg00373.txt.bz2 >>>>> "Yit" == Khoo Yit Phang writes: Yit> I've written a patch to GDB's Python support to allow SIGINT to Yit> interrupt a running script to address the bug Yit> http://sourceware.org/bugzilla/show_bug.cgi?id=13265 (I've attached my Yit> patch to that page). See my other note about how to send the patch; and my other other note about copyright assignments. I don't understand why this code doesn't just pass the old signal handler as an argument to the cleanup function. I think that would be more readable. What happens when the Python code calls back into gdb? We do this in many places in gdb/python/*.c. It seems to me that you'd have to temporarily push gdb's SIGINT handler again. Could we possibly solve this problem without constantly resetting the SIGINT handler? Maybe via a combination of a global flag plus a call into Python from handle_sigint? Our python->gdb exception story is not super. And, we lose information in the round trip. This might (or might not...) be a prerequisite to solving this problem. Tom