This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: [discuss] Support for reverse-execution
- From: Michael Snyder <msnyder at redhat dot com>
- To: gdb at sources dot redhat dot com, Eli Zaretskii <eliz at is dot elta dot co dot il>, Daniel Jacobowitz <drow at mvista dot com>
- Date: Fri, 20 May 2005 14:11:25 -0700
- Subject: Re: [discuss] Support for reverse-execution
In regards to the question "where does a reverse-step put you?"
(ie. at the beginning of a line, or somewhere in the line):
> Sorry, I'm confused. Isn't it right that if I'm stepping
> backwards through code such as this:
>
> i += 1;
> foo (i);
> =>i = 0;
>
> where "=>" shows the current source line, then typing `rnext'
> once will get me to this:
>
> i += 1;
> =>foo (i);
> i = 0;
>
> which means I'm now before the CALL insn that calls `foo'?
I agree with this interpretation. If I am a user (and I am),
and I were to say:
(gdb) step
(gdb) reverse-step (or whatever)
I would expect to be back where I started, ie. at the
*beginning* of the original line.
Dan J. has said that we might need to reverse-stepi until
we've gone back one too many, and then do a forward step.
I agree. In fact, I think it will be necessary to do
the following:
(gdb) reverse-step
# reverse-stepi once (or until we leave the *current* line)
# now establish the step-range start and end (prev line)
# reverse-stepi until we leave the prev line
# stepi once to get back to the desired line.