From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 117557 invoked by alias); 26 Oct 2015 11:45:06 -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 117540 invoked by uid 89); 26 Oct 2015 11:45:04 -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-f42.google.com Received: from mail-pa0-f42.google.com (HELO mail-pa0-f42.google.com) (209.85.220.42) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 26 Oct 2015 11:45:03 +0000 Received: by padhk11 with SMTP id hk11so186876772pad.1 for ; Mon, 26 Oct 2015 04:45:02 -0700 (PDT) X-Received: by 10.66.132.37 with SMTP id or5mr40639049pab.5.1445859902046; Mon, 26 Oct 2015 04:45:02 -0700 (PDT) Received: from E107787-LIN (gcc2-power8.osuosl.org. [140.211.9.43]) by smtp.gmail.com with ESMTPSA id jt1sm33565423pbc.83.2015.10.26.04.44.59 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Mon, 26 Oct 2015 04:45:01 -0700 (PDT) From: Yao Qi To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 06/18] New vCtrlC packet, non-stop mode equivalent of \003 References: <1444836486-25679-1-git-send-email-palves@redhat.com> <1444836486-25679-7-git-send-email-palves@redhat.com> Date: Mon, 26 Oct 2015 14:11:00 -0000 In-Reply-To: <1444836486-25679-7-git-send-email-palves@redhat.com> (Pedro Alves's message of "Wed, 14 Oct 2015 16:27:54 +0100") Message-ID: <86io5t26rr.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-10/txt/msg00555.txt.bz2 Pedro Alves writes: > gdb/ > 2015-10-14 Pedro Alves > > * NEWS (New remote packets): Mention vCtrlC. > > gdb/doc/ > 2015-10-14 Pedro Alves > > * gdb.texinfo (Bootstrapping): Add > "interrupting remote targets" anchor. > (Packets): Document vCtrlC. > > gdb/gdbserver/ > 2015-10-14 Pedro Alves > > * server.c (handle_v_requests): Handle vCtrlC. These entries below should be hoisted above to gdb/ChangeLog, > * remote.c (PACKET_vCtrlC): New enum value. > (async_remote_interrupt): Call target_interrupt instead of > target_stop. > (remote_interrupt_as): Remove 'ptid' parameter. > (remote_interrupt_ns): New function. > (remote_stop): Adjust. > (remote_interrupt): If the target is in non-stop mode, try > interrupting with vCtrlC. > (initialize_remote): Install set remote ctrl-c packet. > --- > gdb/NEWS | 4 ++++ > gdb/doc/gdb.texinfo | 34 +++++++++++++++++++++++---- > gdb/gdbserver/server.c | 7 ++++++ > gdb/remote.c | 64 ++++++++++++++++++++++++++++++++++++++++++++= ------ > 4 files changed, 98 insertions(+), 11 deletions(-) > >=20=20 > +/* Non-stop version of target_interrupt. Uses `vCtrlC' to interrupt > + the remote target. It is undefined which thread of which process > + reports the interrupt. */ > + We need to document the return value of this function in comments. > +static int > +remote_interrupt_ns (void) > +{ > + struct remote_state *rs =3D get_remote_state (); > + char *p =3D rs->buf; > + char *endp =3D rs->buf + get_remote_packet_size (); > + > + xsnprintf (p, endp - p, "vCtrlC"); > + > + /* In non-stop, we get an immediate OK reply. The stop reply will > + come in asynchronously by notification. */ > + putpkt (rs->buf); > + getpkt (&rs->buf, &rs->buf_size, 0); > + > + switch (packet_ok (rs->buf, &remote_protocol_packets[PACKET_vCtrlC])) > + { > + case PACKET_OK: > + break; > + case PACKET_UNKNOWN: > + return 0; > + case PACKET_ERROR: > + error (_("Interrupting target failed: %s"), rs->buf); > + } > + > + return 1; > +} Patch looks good to me otherwise. --=20 Yao (=E9=BD=90=E5=B0=A7)