Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Michael Snyder <msnyder@vmware.com>
Cc: gdb-patches@sourceware.org, drow@false.org,
	pedro@codesourcery.com, teawater@gmail.com
Subject: Re: [RFA] Reverse Debugging, 5/5
Date: Thu, 02 Oct 2008 19:49:00 -0000	[thread overview]
Message-ID: <umyhmixqu.fsf@gnu.org> (raw)
In-Reply-To: <48E3CD66.9020600@vmware.com>

> Date: Wed, 01 Oct 2008 12:20:06 -0700
> From: Michael Snyder <msnyder@vmware.com>
> CC: Daniel Jacobowitz <drow@false.org>,   Pedro Alves <pedro@codesourcery.com>,  teawater <teawater@gmail.com>
> 
> +static void
> +set_exec_direction_func (char *args, int from_tty,
> +			 struct cmd_list_element *cmd)
> +{
> +  if (target_get_execution_direction () != EXEC_ERROR)
> +    {
> +      enum exec_direction_kind dir = EXEC_ERROR;
> +
> +      if (!strcmp (exec_direction, exec_forward))
> +	dir = EXEC_FORWARD;
> +      else if (!strcmp (exec_direction, exec_reverse))
> +	dir = EXEC_REVERSE;
> +
> +      if (target_set_execution_direction (dir) != EXEC_ERROR)
> +	return;
> +    }
> +}

I'm not sure I get your intent with the last two lines: if
target_set_execution_direction returns anything but EXEC_ERROR, you
return, but if not, you ... return?  What am I missing?

> +  case EXEC_ERROR:
> +  default:
> +    fprintf_filtered,  (out, 
> +			_("Target `%s' does not support execution-direction."),
> +			target_shortname);
> +    break;

Why print an error message? isn't it better to say the direction is
"forward" (which is documented as the default in your patch for the
manual)?

> +  if (dir == EXEC_REVERSE)
> +    error (_("Already in reverse mode.  Use '%s' or 'set exec-dir forward'."),
> +	   cmd);

Isn't it better to silently do the equivalent of "cmd"?

> +  add_com ("reverse-step", class_run, reverse_step, _("\
> +Step program backward until it reaches the beginning of another source line.\n\
> +Argument N means do this N times (or till program stops for another reason).")

This sounds as if you are single-stepping the program until it reaches
the previous line (as opposed to running uninterrupted until you hit
previous line).  Are you?

> +  add_com ("reverse-next", class_run, reverse_next, _("\
> +Step program backward, proceeding through subroutine calls.\n\
                        ^
Won't commands like "apropos" stop at the first comma when they
display the short descriptions of commands?

> +@node Reverse Execution
> +@chapter Running programs backward

Please add a @cindex entry here.

> +program was executing normally.  Variables, registers etc. should

Please put a @: after "etc.", to prevent the period being interpreted
by TeX as an end of a sentence.

>                                                    After executing
> +a piece of source code in reverse, all side effects of that code
> +should be ``undone''

ALL side effects?  I thought some of them cannot be undone,
un-outputting to the various I/O devices etc.

> +Assuming you are debugging in a target environment that supports

"IF you are debugging in a target ..." sounds better, I think.

>                                                         Starting from
> +the first line of a function, @code{reverse-next} will take you back
> +to the caller of that function, @emph{before} the function was called.

Shouldn't we have some kind of caveat here regarding function prologue
and epilogue?

> +@item set exec-direction

There should be a @kindex entry here for this command.

Thanks!


  reply	other threads:[~2008-10-02 19:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-01 19:21 Michael Snyder
2008-10-02 19:49 ` Eli Zaretskii [this message]
2008-10-02 21:42   ` Michael Snyder
2008-10-03  6:30     ` Eli Zaretskii
2008-10-03 18:07       ` Michael Snyder
2008-10-04  8:13         ` Eli Zaretskii
2008-10-04 17:56           ` Michael Snyder
2008-10-02 22:43   ` Michael Snyder
2008-10-03  6:35     ` Eli Zaretskii
2008-10-02 22:54   ` Michael Snyder
2008-10-03  6:25     ` Eli Zaretskii
2008-10-03 17:45       ` Daniel Jacobowitz
2008-10-03 17:58       ` Michael Snyder
2008-10-07  3:30 ` Joel Brobecker
2008-10-07 18:25   ` 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=umyhmixqu.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    --cc=msnyder@vmware.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