Re: [PATCH 1/2 version 3] fix for gdb.reverse/finish-precsave.exp and gdb.reverse/finish-reverse.exp

Pedro Alves
2023-01-24T19:26:42Z

On 2023-01-24 7:21 p.m., Pedro Alves wrote:
> And that is the bug. reverse-next/reverse-step should _never_ stop at the same line.
> Same as forward step/next. For instance, this "next" command will just continue
> stepping forever:
>
> Temporary breakpoint 1, main (argc=1, argv=0x7fffffffdc98) at reverse.c:11
> 11 while (1);
> (gdb) next
>
> Same for "step" instead of "next".
>
> It turns out that reverse-next/step do stop immediately!
>
> (gdb) reverse-next
> 11 while (1);
> (gdb) reverse-next
> 11 while (1);
> (gdb)
>
> That's probably caused by the same bug.

From the documentation:

reverse-step [count]
Run the program backward until control reaches the start of a different source line;
^^^^^^^^^

Emphasis mine.