From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 122295 invoked by alias); 3 Dec 2015 17:09:49 -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 122280 invoked by uid 89); 3 Dec 2015 17:09:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f44.google.com Received: from mail-pa0-f44.google.com (HELO mail-pa0-f44.google.com) (209.85.220.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 03 Dec 2015 17:09:47 +0000 Received: by pacdm15 with SMTP id dm15so71895467pac.3 for ; Thu, 03 Dec 2015 09:09:46 -0800 (PST) X-Received: by 10.66.233.73 with SMTP id tu9mr14801043pac.52.1449162586012; Thu, 03 Dec 2015 09:09:46 -0800 (PST) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id 71sm11885606pfj.28.2015.12.03.09.09.42 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 03 Dec 2015 09:09:44 -0800 (PST) From: Yao Qi To: Pedro Alves Cc: Yao Qi , gdb-patches@sourceware.org Subject: Re: exceptions.KeyboardInterrupt is thrown in gdb.base/random-signal.exp References: <86ziy2xdt7.fsf@gmail.com> <5655E141.7030503@redhat.com> <86zixut7ju.fsf@gmail.com> <566039BF.5000207@redhat.com> Date: Thu, 03 Dec 2015 17:09:00 -0000 In-Reply-To: <566039BF.5000207@redhat.com> (Pedro Alves's message of "Thu, 03 Dec 2015 12:46:55 +0000") Message-ID: <86oae7sbl8.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2015-12/txt/msg00055.txt.bz2 Pedro Alves writes: > IMO, if the inferior is running and target_terminal_inferior is not in > effect (*) then the ctrl-c should _not_ trigger a Python > KeyboardInterrupt, but instead > be sent to the target -- if the target is running and we're running some > not-supposed-to-be-interactive Python unwinder code while processing > some internal stop > event, we know that the Python code will finish quickly and the target > should stop > for the SIGINT very soon. IOW, we treat the ctrl-c at exactly the > wrong time as if > it had been pressed a little sooner or later, outside Python. > > (*) - and it shouldn't, while an internal event is being processed. If I understand you correctly, ctrl-c shouldn't trigger a Python KeyboardInterrupt, and we should fix it somewhere in GDB. > > To handle the case of something going wrong and gdb getting stuck in a lo= op too > long that the target's SIGINT takes forever to be processed, we could mak= e gdb > react to a _second_ (impatient) ctrl-c as "okay, I'm sick of waiting, > please stop > whatever you're doing". This is like how remote.c handles ctrl-c at exac= tly the > wrong moment (while an internal event is processed) nowadays: > > https://sourceware.org/ml/gdb-patches/2015-08/msg00574.html I don't know how is this problem related to the second ctrl-c. It is expected that single ctrl-c should interrupt the target, why do we need the second ctrl-c in this case? --=20 Yao (=E9=BD=90=E5=B0=A7)