Open edumoot opened 2 months ago
This case has no problem in GDB context.
$ gdb 310_O1.out
(gdb) b 26
(gdb) r
[...]
Breakpoint 1, func_1 () at 310.c:26
26 for (g_3[0] = 5; (g_3[0] >= 2); g_3[0] -= 1)
(gdb) s
func_6 (p_9=-25, p_7=<optimised out>, p_8=<optimised out>, p_10=<optimised out>, p_11=<optimised out>) at 310.c:45
45 (*g_39) = l_38;
(gdb) s
46 (*l_45) = func_17(l_38, *l_45);
(gdb) s
41 for (p_9 = (-25); (p_9 < (-23)); ++p_9)
(gdb) s
45 (*g_39) = l_38;
$ gdb --version
GNU gdb (Ubuntu 15.0.50.20240403-0ubuntu1) 15.0.50.20240403-git
@llvm/issue-subscribers-lldb
Author: Yachao Zhu (edumoot)
The execution sequence of step commands is inaccurate. Initially, a breakpoint is set at line 26, and after executing the step command, it skips to line 58. When the step command is run again, it jumps back to line 32.
In LLVM18.1.8, we can reproduce with:
cat 310.c