Re: [RFA] Resubmit, reverse debugging [0/5]

Michael Snyder
2008-10-11T02:48:38Z

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

Daniel Jacobowitz wrote:
> On Fri, Oct 10, 2008 at 11:35:17AM -0700, Michael Snyder wrote:
>> OK, I agree -- but it's in use, in the field.
>>
>> Wouldn't the practice be to deprecate it, and announce
>> the intention of removing it at some future time, rather
>> than just suddenly take it away?
>
> Sorry, but it's hard to be sympathetic to this. I go through this on
> a regular basis, so do other GDB contributors: it's the risk you take
> for deploying things before they're merged. If you don't get at least
> the protocol documentation committed to the master repository, then
> this is what happens.

Fine, but we want to encourage outside contribution, don't we?
VirtuTech were the original contributors of this functionality,
(albeit they wouldn't recognize more than a line or two of code
by now, this being one of them). Can you blame them for not
waiting two years to distribute it? In this industry, that is
the equivalent of several lifetimes.

Can't we compromise, and be nice to them, to thank them
for the contribution?

> Speaking of documentation, is there a documentation part for the
> remote protocol changes? I haven't seen one in the most recent patch
> set, and I don't want any new protocol extensions without docs (for
> the obvious reason).

OK, here's a patch that adds
1) remote protocol documentation
2) The requested extension to the 'T' reply to replace E06
3) A big honking "deprecated" warning for E06.

Tested using gdb-freeplay.
Is this good?

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

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

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

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

* gdb.texinfo: Document the 'bc' and 'bs' (reverse) commands,
and the 'replaylog' annotation of the 'T' stop event message.

Index: remote.c
===================================================================
RCS file: /cvs/src/src/gdb/remote.c,v
retrieving revision 1.310.2.4
diff -u -p -r1.310.2.4 remote.c
--- remote.c 8 Oct 2008 00:26:28 -0000 1.310.2.4
+++ remote.c 10 Oct 2008 20:37:48 -0000
@@ -3616,6 +3616,7 @@ remote_wait (ptid_t ptid, struct target_
ptid_t event_ptid = null_ptid;
ULONGEST addr;
int solibs_changed = 0;
+ int replay_event = 0;

status->kind = TARGET_WAITKIND_EXITED;
status->value.integer = 0;
@@ -3661,6 +3662,7 @@ remote_wait (ptid_t ptid, struct target_
warning (_("Remote failure reply: %s"), buf);
if (buf[1] == '0' && buf[2] == '6')
{
+ warning (_("Use of 'E6' to indicate NO_HISTORY is deprecated, and will go away in a future GDB release."));
status->kind = TARGET_WAITKIND_NO_HISTORY;
}
else
@@ -3734,6 +3736,16 @@ Packet: '%s'\n"),
solibs_changed = 1;
p = p_temp;
}
+ else if (strncmp (p, "replaylog", p1 - 1) == 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. */
@@ -3779,6 +3791,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;
Index: doc/gdb.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v
retrieving revision 1.525.2.3
diff -u -p -r1.525.2.3 gdb.texinfo
--- doc/gdb.texinfo 4 Oct 2008 19:11:51 -0000 1.525.2.3
+++ doc/gdb.texinfo 10 Oct 2008 20:37:49 -0000
@@ -24611,6 +24611,20 @@ breakpoint at @var{addr}.
Don't use this packet. Use the @samp{Z} and @samp{z} packets instead
(@pxref{insert breakpoint or watchpoint packet}).

+@item bc
+@cindex @samp{bc} packet
+Backward continue. Execute the target system in reverse. No parameter.
+
+Reply:
+@xref{Stop Reply Packets}, for the reply specifications.
+
+@item bs
+@cindex @samp{bs} packet
+Backward single step. Execute one instruction in reverse. No parameter.
+
+Reply:
+@xref{Stop Reply Packets}, for the reply specifications.
+
@item c @r{[}@var{addr}@r{]}
@cindex @samp{c} packet
Continue. @var{addr} is address to resume. If @var{addr} is omitted,
@@ -25228,6 +25242,14 @@ hex.
The packet indicates that the loaded libraries have changed.
@value{GDBN} should use @samp{qXfer:libraries:read} to fetch a new
list of loaded libraries. @var{r} is ignored.
+
+@cindex replay log events, remote reply
+@item replaylog
+The packet indicates that the target cannot continue replaying
+logged execution events, because it has reached the end (or the
+beginning when executing backward) of the log. The value of @var{r}
+will be either @samp{begin} or @samp{end}.
+
@end table

@item W @var{AA}