RE: reverse for GDB/MI

Jakob Engblom
2008-12-19T13:32:16Z

> Me too. It's confusing because "reverse-finish" isn't really doing a reverse
> "finish". If it were, a "finish", followed by a "reverse-finish" (or the
> other way around) would bring you to the original state, like a "step"
followed
> by
> a "reverse-step" tries to (it can't be 100% accurate, but still).

Good point. Reverse-x naming works when x and rev-x cancel each other. Which is
pretty much limited to instruction step or moving a certain number of machine
instructions forward or backward. On source level, you get other expected
behavior.

For example, if you have

A;
Call(b);
C;

And sit at "C" and do a reverse-step, you might well end up at A as that is
stepping back in the same function. While inside b, doing a step that hits a
return will put you at C, but unstepping is then contrained to do so in the
scope you are in. Anything else than instruction back or forward can have
asymmetric behavior due to the way function scope affect the behavior of
debugging commands.

> I think someone just proposed to rename "reverse-finish" to "uncall", that
> although
> may sound weird at first, states much clearly what the "reverse-finish"
command
> really does.

Uncall is a good name, as it makes it much clearer what is going on.

/jakob