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

Tom de Vries via Gdb-patches
2023-01-24T15:53:26Z

On 1/23/23 20:17, Pedro Alves wrote:
> I'd think this was on purpose. Note that next/step/reverse-{next/step} are line-oriented
> stepping commands, they step/next until the previous/next line. While "finish" is described
> as undoing the_function call_.
>
> The manual says:
>
> reverse-finish
> Just as the finish command takes you to the point where the current function returns,
> reverse-finish takes you to the point where it was called. Instead of ending up at the end of
> the current function invocation, you end up at the beginning.

As well as:
...
finish
Continue running until just after function in the selected stack frame
returns. Print the returned value (if any). This command can be
abbreviated as fin.
...

It's only now that you mention the non-line nature of
finish/reverse-finish that I realize that that is the case. So I
suppose the docs could be a bit more explicit about this aspect.

I suppose an intuitive way to make available the two approaches (so
without the user losing options) would be to introduce finishi next to
finish and reverse-finishi next to finish, with the new commands
retaining the current functionality and the old ones being adjusted to
respect line boundaries. But having the commands change behaviour is
likely to cause confusion (well, assuming users notice the difference in
the first place), so I'm not sure if that's a good idea.

Thanks,
- Tom