Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@vmware.com>
To: Hui Zhu <teawater@gmail.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
	  Jakob Engblom <jakob@virtutech.com>,
	 Pedro Alves <pedro@codesourcery.com>,
	Greg Law <glaw@undo-software.com>
Subject: Re: [PATCH] Add 'reverse' capability query to remote protocol  	(qSupported).
Date: Tue, 01 Sep 2009 04:02:00 -0000	[thread overview]
Message-ID: <4A9C9CD2.7030207@vmware.com> (raw)
In-Reply-To: <daef60380908311943u447649edy3ed031b43adaea27@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 253 bytes --]

Hui Zhu wrote:
> Should we need update them?
> static int remote_target_can_reverse = 1;
> 
> static int
> remote_can_execute_reverse (void)
> {
>   return remote_target_can_reverse;
> }

Right!  I forgot about it -- thanks for reminding me.
New diff.


[-- Attachment #2: qStatus-2.txt --]
[-- Type: text/plain, Size: 2620 bytes --]

2009-08-31  Michael Snyder  <msnyder@vmware.com>

	* remote.c (PACKET_bc, PACKET_bs): New enums.
	(remote_protocol_features): Add ReverseStep, ReverseContinue.
	(remote_resume): Check for reverse capability.
	(remote_can_execute_reverse): Use packet config variables.
	(_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	1 Sep 2009 04:01:04 -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)
@@ -8730,12 +8744,14 @@ remote_command (char *args, int from_tty
   help_list (remote_cmdlist, "remote ", -1, gdb_stdout);
 }
 
-static int remote_target_can_reverse = 1;
-
 static int
 remote_can_execute_reverse (void)
 {
-  return remote_target_can_reverse;
+  if (remote_protocol_packets[PACKET_bs].support == PACKET_ENABLE
+      || remote_protocol_packets[PACKET_bc].support == PACKET_ENABLE)
+    return 1;
+  else
+    return 0;
 }
 
 static int
@@ -9165,6 +9181,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);
 

  reply	other threads:[~2009-09-01  4:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-31 20:02 Michael Snyder
2009-09-01  2:44 ` Hui Zhu
2009-09-01  4:02   ` Michael Snyder [this message]
2009-09-01  4:44     ` Hui Zhu
2009-09-01 15:52     ` Pedro Alves
2009-09-01 15:44 ` Pedro Alves
2009-09-01 17:07   ` Eli Zaretskii
2009-09-06  3:37     ` Michael Snyder
2009-09-06 17:05       ` Eli Zaretskii
2009-09-07 21:29       ` Pedro Alves
2009-09-07 22:19         ` Michael Snyder
2009-09-07 22:20           ` Michael Snyder
2009-09-07 22:33             ` Pedro Alves
2009-09-08  7:40           ` Greg Law
2009-09-09 10:45             ` Jakob Engblom
2009-09-10 21:03               ` Michael Snyder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A9C9CD2.7030207@vmware.com \
    --to=msnyder@vmware.com \
    --cc=gdb-patches@sourceware.org \
    --cc=glaw@undo-software.com \
    --cc=jakob@virtutech.com \
    --cc=pedro@codesourcery.com \
    --cc=teawater@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox