Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@vmware.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
	  Daniel Jacobowitz <drow@false.org>
Subject: Re: [RFA] Resubmit, reverse debugging [0/5]
Date: Mon, 13 Oct 2008 19:22:00 -0000	[thread overview]
Message-ID: <48F39F2B.7040506@vmware.com> (raw)
In-Reply-To: <20081011094636.GA3613@adacore.com>

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

Joel Brobecker wrote:
>> OK, I agree -- but it's in use, in the field.
> 
> I don't see this as a factor. If people want to use the version of the
> protocol that has been deployed, then they can stick with the debugger
> provided by the associated vendors. If they want to use the FSF GDB,
> then they have to migrate.  We're not suddenly dropping a feature that
> we used to support. If we look at Ada as an example, there are several
> features that AdaCore contributed which got redesigned as the result of
> the review process.  That meant that people using GPS (AdaCore's GUI)
> would have some compatibility issues with the FSF GDB for a while, until
> we enhanced GDB to recognize the way we implemented the given feature
> for the FSF. We have done that a few times, now.
> 
> Personally, after having had protocol compatibility issues between
> a vendor-supplied gdbserver and our GDB, putting a new packet only to
> remove it later is, IMO, asking for the same trouble again.

OK, thanks guys -- I'll remove it.
Revised patch attached.

Is this perchance the final issue?



[-- Attachment #2: remote.e6.txt --]
[-- Type: text/plain, Size: 3228 bytes --]

2008-10-13  Michael Snyder  <msnyder@vmware.com>

	* remote.c (remote_wait): Remove handling of "E6" no_history error.
	Recognize "replaylog" reply as part of 'T' stop event
	(NO_HISTORY).  Declare "end of replay history" error reply
	as deprecated.

	Remote interface for reverse debugging.
	* remote.c (remote_can_execute_reverse): New target method.
	(remote_resume): Check for reverse exec direction, and send 
	appropriate command to target.
	(remote_wait): Check target response for NO_HISTORY status.
	Also check for empty reply (target doesn't understand "bs" or "bc).
	(remote_vcont_resume): Jump out if attempting reverse execution.

Index: remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.316
diff -u -p -r1.316 remote.c
--- remote.c	10 Oct 2008 14:46:31 -0000	1.316
+++ remote.c	13 Oct 2008 19:06:21 -0000
@@ -3405,7 +3405,15 @@ remote_resume (ptid_t ptid, int step, en
     set_continue_thread (ptid);
 
   buf = rs->buf;
-  if (siggnal != TARGET_SIGNAL_0)
+  if (execution_direction == EXEC_REVERSE)
+    {
+      /* We don't pass signals to the target in reverse exec mode.  */
+      if (info_verbose && siggnal != TARGET_SIGNAL_0)
+	warning (" - Can't pass signal %d to target in reverse: ignored.\n",
+		 siggnal);
+      strcpy (buf, step ? "bs" : "bc");
+    }
+  else if (siggnal != TARGET_SIGNAL_0)
     {
       buf[0] = step ? 'S' : 'C';
       buf[1] = tohex (((int) siggnal >> 4) & 0xf);
@@ -3634,6 +3642,7 @@ remote_wait_as (ptid_t ptid, struct targ
   ptid_t event_ptid = null_ptid;
   ULONGEST addr;
   int solibs_changed = 0;
+  int replay_event = 0;
   char *buf, *p;
 
   status->kind = TARGET_WAITKIND_IGNORE;
@@ -3749,6 +3758,16 @@ Packet: '%s'\n"),
 		    solibs_changed = 1;
 		    p = p_temp;
 		  }
+		else if (strncmp (p, "replaylog", p1 - p) == 0)
+		  {
+		    /* NO_HISTORY event.
+		       p1 will indicate "begin" or "end", but
+		       it makes no difference for now, so ignore it.  */
+		    replay_event = 1;
+		    p_temp = strchr (p1 + 1, ';');
+		    if (p_temp)
+		      p = p_temp;
+		  }
 		else
 		  {
 		    /* Silently skip unknown optional info.  */
@@ -3794,6 +3813,8 @@ Packet: '%s'\n"),
     case 'S':		/* Old style status, just signal only.  */
       if (solibs_changed)
 	status->kind = TARGET_WAITKIND_LOADED;
+      else if (replay_event)
+            status->kind = TARGET_WAITKIND_NO_HISTORY;
       else
 	{
 	  status->kind = TARGET_WAITKIND_STOPPED;
@@ -7615,6 +7636,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;
+}
+
 static void
 init_remote_ops (void)
 {
@@ -7663,6 +7692,7 @@ Specify the serial device it is connecte
   remote_ops.to_has_registers = 1;
   remote_ops.to_has_execution = 1;
   remote_ops.to_has_thread_control = tc_schedlock;	/* can lock scheduler */
+  remote_ops.to_can_execute_reverse = remote_can_execute_reverse;
   remote_ops.to_magic = OPS_MAGIC;
   remote_ops.to_memory_map = remote_memory_map;
   remote_ops.to_flash_erase = remote_flash_erase;

      reply	other threads:[~2008-10-13 19:22 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-08  2:17 Michael Snyder
2008-10-10 17:44 ` Michael Snyder
2008-10-10 17:54   ` Daniel Jacobowitz
2008-10-10 18:38     ` Michael Snyder
2008-10-11  2:43       ` Daniel Jacobowitz
2008-10-11  2:48         ` Michael Snyder
2008-10-11  8:02           ` Eli Zaretskii
2008-10-13 19:21             ` Michael Snyder
2008-10-14  7:56               ` Jakob Engblom
2008-10-14  9:07                 ` teawater
2008-10-14 12:24                   ` Daniel Jacobowitz
2008-10-14 12:27           ` Daniel Jacobowitz
2008-10-15 18:20             ` Michael Snyder
2008-10-15 18:30               ` Daniel Jacobowitz
2008-10-15 18:42                 ` Michael Snyder
2008-10-15 18:47                   ` Pedro Alves
2008-10-15 18:49                     ` Michael Snyder
2008-10-11  9:47       ` Joel Brobecker
2008-10-13 19:22         ` Michael Snyder [this message]

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=48F39F2B.7040506@vmware.com \
    --to=msnyder@vmware.com \
    --cc=brobecker@adacore.com \
    --cc=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    /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