Re: [discuss] Support for reverse-execution

Vladimir Prus
2005-05-20T15:05:17Z

Michael Snyder wrote:

> I'd like to start adding some commands to gdb to support targets
> that can perform reverse execution (eg. stepping backwards).
> This concept has been around for a number of years now, and I
> have access to a target (the Simics simulator from Virtutech)
> that does it quite handily.
>
> I propose we add something like the following commands
> (names open to discussion):
>
> reverse-continue -- start executing backwards until something
> interesting happens (most likely hitting a breakpoint).
>
> reverse-stepi -- "un-execute" the previous instruction.
>
> reverse-step -- "un-execute" the previous source line.
>
> reverse-finish or "un-call" -- proceed backward until
> the current function is about to be called by its caller.
>
> reverse-until... etc.

Would not it be better to have a single "reverse" command which puts the
debugger in "reverse" mode -- making step/stepi/next/nexti go backward.

This might be handier for UI -- after all "step" can be abbreviated as 's',
but reverse-step can't be abbreviated. This might be better in GUI too --
instead of doubling the number of "step" commands you'd have a single
"gear" switch, that can be in either "forward" or "reverse" position.

- Volodya