From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23671 invoked by alias); 31 Aug 2009 19:56:14 -0000 Received: (qmail 23660 invoked by uid 22791); 31 Aug 2009 19:56:13 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,SARE_SUB_OBFU_Q1 X-Spam-Check-By: sourceware.org Received: from smtp-outbound-2.vmware.com (HELO smtp-outbound-2.vmware.com) (65.115.85.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 31 Aug 2009 19:56:08 +0000 Received: from mailhost2.vmware.com (mailhost2.vmware.com [10.16.67.167]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id CBCA551005; Mon, 31 Aug 2009 12:56:06 -0700 (PDT) Received: from [10.20.94.141] (msnyder-server.eng.vmware.com [10.20.94.141]) by mailhost2.vmware.com (Postfix) with ESMTP id 9B0BD8E8D6; Mon, 31 Aug 2009 12:56:06 -0700 (PDT) Message-ID: <4A9C2AD3.5070904@vmware.com> Date: Mon, 31 Aug 2009 20:02:00 -0000 From: Michael Snyder User-Agent: Thunderbird 1.5.0.12 (X11/20080411) MIME-Version: 1.0 To: "gdb-patches@sourceware.org" , Jakob Engblom , Pedro Alves , Greg Law Subject: [PATCH] Add 'reverse' capability query to remote protocol (qSupported). Content-Type: multipart/mixed; boundary="------------080000040003050001030902" 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-08/txt/msg00591.txt.bz2 This is a multi-part message in MIME format. --------------080000040003050001030902 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 766 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: ReverseContinue+;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): set remote reverse-continue on set remote reverse-step on Pedro, does this look like what you expected? Michael --------------080000040003050001030902 Content-Type: text/plain; name="qStatus.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="qStatus.txt" Content-length: 2108 2009-08-31 Michael Snyder * remote.c (PACKET_bc, PACKET_bs): New enums. (remote_protocol_features): Add ReverseStep, ReverseContinue. (remote_resume): Check for reverse capability. (_initialize_remote): Add packet config for "bs" and "bc" packets. Index: remote.c =================================================================== RCS file: /cvs/src/src/gdb/remote.c,v retrieving revision 1.370 diff -u -p -r1.370 remote.c --- remote.c 18 Aug 2009 16:17:16 -0000 1.370 +++ remote.c 31 Aug 2009 19:55:21 -0000 @@ -1000,6 +1000,8 @@ enum { PACKET_qXfer_siginfo_write, PACKET_qAttached, PACKET_ConditionalTracepoints, + PACKET_bc, + PACKET_bs, PACKET_MAX }; @@ -3051,6 +3053,10 @@ static struct protocol_feature remote_pr PACKET_qXfer_siginfo_write }, { "ConditionalTracepoints", PACKET_DISABLE, remote_cond_tracepoint_feature, PACKET_ConditionalTracepoints }, + { "ReverseContinue", PACKET_DISABLE, remote_supported_packet, + PACKET_bc }, + { "ReverseStep", PACKET_DISABLE, remote_supported_packet, + PACKET_bs }, }; static void @@ -3818,6 +3824,14 @@ remote_resume (struct target_ops *ops, if (info_verbose && siggnal != TARGET_SIGNAL_0) warning (" - Can't pass signal %d to target in reverse: ignored.\n", siggnal); + + if (step && + remote_protocol_packets[PACKET_bs].support == PACKET_DISABLE) + error ("Remote reverse-step not supported."); + if (!step && + remote_protocol_packets[PACKET_bc].support == PACKET_DISABLE) + error ("Remote reverse-continue not supported."); + strcpy (buf, step ? "bs" : "bc"); } else if (siggnal != TARGET_SIGNAL_0) @@ -9165,6 +9179,12 @@ Show the maximum size of the address (in "qGetTLSAddr", "get-thread-local-storage-address", 0); + add_packet_config_cmd (&remote_protocol_packets[PACKET_bc], + "bc", "reverse-continue", 0); + + add_packet_config_cmd (&remote_protocol_packets[PACKET_bs], + "bs", "reverse-step", 0); + add_packet_config_cmd (&remote_protocol_packets[PACKET_qSupported], "qSupported", "supported-packets", 0); --------------080000040003050001030902--