From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 121645 invoked by alias); 7 Jan 2016 17:26:52 -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 121634 invoked by uid 89); 7 Jan 2016 17:26:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=alright, Hx-languages-length:1156, UD:msg00307.html, msg00307html X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 07 Jan 2016 17:26:51 +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 (Postfix) with ESMTPS id E1D60E7094; Thu, 7 Jan 2016 17:26:49 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u07HQmuv014662; Thu, 7 Jan 2016 12:26:49 -0500 Message-ID: <568E9FD8.6050705@redhat.com> Date: Thu, 07 Jan 2016 17:26:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Yao Qi CC: gdb-patches@sourceware.org Subject: Re: [RFC 1/2] Check input interrupt first when reading packet References: <1450697443-29067-1-git-send-email-yao.qi@linaro.org> <1450697443-29067-2-git-send-email-yao.qi@linaro.org> <568AAEA6.4050303@redhat.com> <86lh84x9i0.fsf@gmail.com> In-Reply-To: <86lh84x9i0.fsf@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-01/txt/msg00110.txt.bz2 On 01/05/2016 04:43 PM, Yao Qi wrote: > Pedro Alves writes: > > Hi Pedro, > sorry for the delayed reply. Takes much time reading these patches and > discussions in archives. Likewise here. > I am inclined to tweak the doc as well, because looks people at that > moment believed that ^C is meaningless when the target is stopped. > See https://www.sourceware.org/ml/gdb-patches/2005-11/msg00307.html Alright, let's do this then. >>> diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c >>> index 05e3d63..8bb5b13 100644 >>> --- a/gdb/gdbserver/remote-utils.c >>> +++ b/gdb/gdbserver/remote-utils.c >>> @@ -959,6 +959,15 @@ getpkt (char *buf) >>> while (1) >>> { >>> c = readchar (); >>> + >>> + /* The '\003' may appear before or after each packet, so >>> + check for an input interrupt. */ >>> + if (c == '\003') >>> + { >>> + (*the_target->request_interrupt) (); >>> + c = readchar (); >> >> I'd write "continue;" instead of another readchar, >> >> (Pedantically, you could have another '\003' in the buffer.) > > Done. LGTM. Thanks, Pedro Alves