Re: [discuss] Support for reverse-execution

Eli Zaretskii
2005-05-20T14:12:52Z

> Date: Fri, 20 May 2005 14:22:22 +0200
> From: Johan Rydberg <jrydberg@virtutech.com>
> Cc: dan@shearer.org, gdb@sources.redhat.com
>
> (1) foo (i);
> 0: 80 7f 00 08 lwz r3,8(r31)
> 4: 48 00 00 01 bl X <foo>
> 8: nop
> (2) i = 0;
> c: 38 00 00 00 li r0,0
> 10: 90 1f 00 08 stw r0,8(r31)
>
> <foo>:
> ....
> 4c: 4e 80 00 20 blr
>
> You start with PC = c, and single steps backwards. You end up on
> the nop-insn. This is inside the single step range of line 1. So
> you single step another instruction backwards, and suddenly you
> stop at PC = 4c

I guess I don't understand how backwards movement works, because I
thought stepping backwards over the branch instruction does _not_ take
the branch, but rather rewinds the machine state to what it was before
the branch instruction.

Anyway, thanks for the explanations.

> >>+ add_com_alias ("rn", "rnext", class_run, 1);
> >
> > Do we want another alias called "previous"?
>
> I think so, and maybe also "prev" and/or "pre".

The additional aliases won't be necessary, since they both are
unambiguous abbreviations of "previous". So they will work even if we
don't define them as aliases.