From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23060 invoked by alias); 1 Sep 2009 02:44:06 -0000 Received: (qmail 23027 invoked by uid 22791); 1 Sep 2009 02:44:05 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_23,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 02:43:53 +0000 Received: by pzk15 with SMTP id 15so3369726pzk.24 for ; Mon, 31 Aug 2009 19:43:51 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.195.3 with SMTP id s3mr43211wff.172.1251773031283; Mon, 31 Aug 2009 19:43:51 -0700 (PDT) In-Reply-To: <4A9C2AD3.5070904@vmware.com> References: <4A9C2AD3.5070904@vmware.com> From: Hui Zhu Date: Tue, 01 Sep 2009 02: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/msg00004.txt.bz2 Should we need update them? static int remote_target_can_reverse =3D 1; static int remote_can_execute_reverse (void) { return remote_target_can_reverse; } Thanks, Hui On Tue, Sep 1, 2009 at 03:56, Michael Snyder wrote: > Following discussion, this patch adds feature capability handling > (enable, disable, and automatic "qSupported" query) for the reverse > execution packets "bs" (backward step) and "bc" (backward continue > in the gdb remote protocol. > > Cc:ing Jakob and Greg, whose remote targets may be affected. > What you guys will want to do is have your remote targets > recognize the "qSupported" query from gdb, and respond with: > > =A0 =A0 =A0 =A0ReverseContinue+;ReverseStep+ > > This will tell gdb that your targets support those two commands. > > Otherwise, they default to "disabled", and a user would need > to enable them with these commands (which might be added to a > .gdbinit file): > > =A0 =A0 =A0 =A0set remote reverse-continue on > =A0 =A0 =A0 =A0set remote reverse-step on > > Pedro, does this look like what you expected? > > Michael > > > 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(_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 =A031 Aug 2009 19:55:21 -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) > @@ -9165,6 +9179,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); > > >