From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29911 invoked by alias); 1 Sep 2009 04:44:26 -0000 Received: (qmail 29900 invoked by uid 22791); 1 Sep 2009 04:44:25 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SARE_SUB_OBFU_Q1,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-pz0-f185.google.com (HELO mail-pz0-f185.google.com) (209.85.222.185) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 01 Sep 2009 04:44:18 +0000 Received: by pzk15 with SMTP id 15so3485805pzk.24 for ; Mon, 31 Aug 2009 21:44:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.248.2 with SMTP id v2mr45743wfh.177.1251780256074; Mon, 31 Aug 2009 21:44:16 -0700 (PDT) In-Reply-To: <4A9C9CD2.7030207@vmware.com> References: <4A9C2AD3.5070904@vmware.com> <4A9C9CD2.7030207@vmware.com> From: Hui Zhu Date: Tue, 01 Sep 2009 04:44:00 -0000 Message-ID: Subject: Re: [PATCH] Add 'reverse' capability query to remote protocol (qSupported). To: Michael Snyder Cc: "gdb-patches@sourceware.org" , Jakob Engblom , Pedro Alves , Greg Law Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes 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: 2009-09/txt/msg00007.txt.bz2 On Tue, Sep 1, 2009 at 12:02, Michael Snyder wrote: > Hui Zhu wrote: >> >> Should we need update them? >> static int remote_target_can_reverse =3D 1; >> >> static int >> remote_can_execute_reverse (void) >> { >> =A0return remote_target_can_reverse; >> } > > Right! =A0I forgot about it -- thanks for reminding me. > New diff. > > Thanks. I think this version is better. Hui > 2009-08-31 =A0Michael Snyder =A0 > > =A0 =A0 =A0 =A0* remote.c (PACKET_bc, PACKET_bs): New enums. > =A0 =A0 =A0 =A0(remote_protocol_features): Add ReverseStep, ReverseContin= ue. > =A0 =A0 =A0 =A0(remote_resume): Check for reverse capability. > =A0 =A0 =A0 =A0(remote_can_execute_reverse): Use packet config variables. > =A0 =A0 =A0 =A0(_initialize_remote): Add packet config for "bs" and "bc" = packets. > > Index: remote.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > RCS file: /cvs/src/src/gdb/remote.c,v > retrieving revision 1.370 > diff -u -p -r1.370 remote.c > --- remote.c =A0 =A018 Aug 2009 16:17:16 -0000 =A0 =A0 =A01.370 > +++ remote.c =A0 =A01 Sep 2009 04:01:04 -0000 > @@ -1000,6 +1000,8 @@ enum { > =A0 PACKET_qXfer_siginfo_write, > =A0 PACKET_qAttached, > =A0 PACKET_ConditionalTracepoints, > + =A0PACKET_bc, > + =A0PACKET_bs, > =A0 PACKET_MAX > =A0}; > > @@ -3051,6 +3053,10 @@ static struct protocol_feature remote_pr > =A0 =A0 PACKET_qXfer_siginfo_write }, > =A0 { "ConditionalTracepoints", PACKET_DISABLE, > remote_cond_tracepoint_feature, > =A0 =A0 PACKET_ConditionalTracepoints }, > + =A0{ "ReverseContinue", PACKET_DISABLE, remote_supported_packet, > + =A0 =A0PACKET_bc }, > + =A0{ "ReverseStep", PACKET_DISABLE, remote_supported_packet, > + =A0 =A0PACKET_bs }, > =A0}; > > =A0static void > @@ -3818,6 +3824,14 @@ remote_resume (struct target_ops *ops, > =A0 =A0 =A0 if (info_verbose && siggnal !=3D TARGET_SIGNAL_0) > =A0 =A0 =A0 =A0warning (" - Can't pass signal %d to target in reverse: ig= nored.\n", > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 siggnal); > + > + =A0 =A0 =A0if (step && > + =A0 =A0 =A0 =A0 remote_protocol_packets[PACKET_bs].support =3D=3D PACKE= T_DISABLE) > + =A0 =A0 =A0 error ("Remote reverse-step not supported."); > + =A0 =A0 =A0if (!step && > + =A0 =A0 =A0 =A0 remote_protocol_packets[PACKET_bc].support =3D=3D PACKE= T_DISABLE) > + =A0 =A0 =A0 error ("Remote reverse-continue not supported."); > + > =A0 =A0 =A0 strcpy (buf, step ? "bs" : "bc"); > =A0 =A0 } > =A0 else if (siggnal !=3D TARGET_SIGNAL_0) > @@ -8730,12 +8744,14 @@ remote_command (char *args, int from_tty > =A0 help_list (remote_cmdlist, "remote ", -1, gdb_stdout); > =A0} > > -static int remote_target_can_reverse =3D 1; > - > =A0static int > =A0remote_can_execute_reverse (void) > =A0{ > - =A0return remote_target_can_reverse; > + =A0if (remote_protocol_packets[PACKET_bs].support =3D=3D PACKET_ENABLE > + =A0 =A0 =A0|| remote_protocol_packets[PACKET_bc].support =3D=3D PACKET_= ENABLE) > + =A0 =A0return 1; > + =A0else > + =A0 =A0return 0; > =A0} > > =A0static int > @@ -9165,6 +9181,12 @@ Show the maximum size of the address (in > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "qGetTLSAddr", "get-threa= d-local-storage-address", > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 0); > > + =A0add_packet_config_cmd (&remote_protocol_packets[PACKET_bc], > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"bc", "reverse-continue"= , 0); > + > + =A0add_packet_config_cmd (&remote_protocol_packets[PACKET_bs], > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"bs", "reverse-step", 0); > + > =A0 add_packet_config_cmd (&remote_protocol_packets[PACKET_qSupported], > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "qSupported", "supported-= packets", 0); > > >