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

Carl Love via Gdb-patches
2023-01-25T19:39:41Z

Pedro, Ulrich, Tom, Bruno:

On Wed, 2023-01-25 at 17:24 +0000, Pedro Alves wrote:
> On 2023-01-25 5:13 p.m., Ulrich Weigand wrote:
> > > Breakpoint 1, func2 (i=1) at finish.c:8
> > > 8 return i + 1;
> > > (gdb) step
> > > 9 }
> > > <<< stopped a line bounary, and stepped over the func1
> > > call as well!
> > > (gdb) p $pc
> > > $3 = (void (*)()) 0x55555555514d <func2+17>
> > So this is still at the return in func2,
>
> Whoops, the example that I quickly typed up didn't actually have an
> explicit return
> line when I first tried it (it returned void), and then I thought of
> adding one and I added it
> I missed that I now needed one extra step to get out of func,
> thinking I was at the last
> line of main already.
>
> > but you're right,
> > the next step brings us directly to func1 without stopping
> > in main at all. This is indeed unlike finish.
> >
>
> Exactly.
>
> > > I disagree.
> > OK, you've convinced me as well. Sorry for the confusion ...
>
> No worries!

OK, so there seems to be agreement that we do not want to move forward
with this patch to change the behavior of the reverse-finish command.
The consensus is the reverse-finish command is working as expected. So,
I formally withdraw patch 1 of 2 from consideration.

I worked on a patch with Luis, who is now busy with other things, to
fix the issue of two "simple" executable statements on a line not
working. The patch fixed that issue, but does not fix the example from
Pedro of two function calls in the same source line. So, I will pickup
this patch again and see if I can get the patch to correctly handle
column debug info and the is-stmt entry stuff and not break clang.

The second patch in this series address the reverse-finish command on
PowerPC which does not work due to the multiple entry points used in
PowerPC. I will rework the PowerPC patch to apply on mainline to
address the PowerPC issues so the reverse-finish command will behave
the same as on X86. This is probably the simpler/easier of the two
patches to do.

Thanks for all the discussion and help with this issue.

Carl