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

Pedro Alves
2023-01-25T17:24:25Z

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!