<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/92857>92857</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
For the same program, gdb and lldb have different execution paths.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
IOVOVHS
</td>
</tr>
</table>
<pre>
A program generated by csmith and compiled by gcc with O2.It results in different breakpoints and execution locations for gdb and lldb.
On gdb:
(gdb)b func_1
(gdb)run
gdb shows : Breakpoint 1, func_1 () at /home/hzw/experiment/csmith_prog/random_24.c:297
297 l_2372[2][3][1] |= func_9((*l_4));
(gdb)s
gdb shows :0x00005555555550b1 in func_9 (p_10=0) at /home/hzw/experiment/csmith_prog/random_24.c:1488
1488 func_1();
On lldb:
(lldb) b func_1
(lldb) r
-> 325 for (g_6 = 0; (g_6 >= 0); g_6 -= 1) ##func_7
(lldb) s
-> 1504 csmith_sink_ = g_32.f0; ##main
gdb stops at func_1 and reaches func_7. lldb reaches func_7 directly even though it breaks at func_1. I am using lldb's python API after that and it shows a warning:
warning: inlined block 0x1abd doesn't have a range that contains file address 0x10b1 in /home/hzw/experiment/csmith_prog_bin_O2/random_24
It seems that lldb is not parsing the debugging information of the function after inlining correctly.
- gcc version:gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2)
- lldb version:lldb version 15.0.7
- gdb version::GNU gdb (Ubuntu 9.2-0ubuntu1~20.04.1) 9.2
- platform:Ubuntu 20.
[test_case.zip](https://github.com/llvm/llvm-project/files/15384759/test_case.zip)
04
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykVU-Po7gT_TTOpRRkCmjCIYdkMvn9-rK90mrmigwU4B2wkW36zxz2s69syITumcOuFkUiVcb16r0qu4S1slNER5adWXbZidn12hwfn74-ff3_H7tKN2_HE0xGd0aM0JEiIxw1UL1BbUfpehCq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