<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/62950>62950</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
An indeed executed source line is not hit in lldb
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
yangyibiao
</td>
</tr>
</table>
<pre>
```
$ clang -Og -g small.c
$ lldb a.out
(lldb) target create "a.out"
Current executable set to '/root/a.out' (x86_64).
(lldb) b main
Breakpoint 1: where = a.out`main + 5 at small.c:14:6, address = 0x0000000000000625
(lldb) r
...
(lldb) s
Process 46264 stopped
* thread #1, name = 'a.out', stop reason = step in
frame #0: 0x0000555555554631 a.out`main(argc=1, argv=0x00007fffffffe4e8) at small.c:15:6
12 char c;
13
14 pb = &b;
-> 15 pc = &c;
16
17 access (pb);
18 access (pc);
(lldb) s
Process 46264 stopped
* thread #1, name = 'a.out', stop reason = step in
frame #0: 0x0000555555554638 a.out`main(argc=1, argv=0x00007fffffffe4e8) at small.c:17:3
14 pb = &b;
15 pc = &c;
16
-> 17 access (pb);
18 access (pc);
19
20 return 0;
(lldb) s
Process 46264 stopped
* thread #1, name = 'a.out', stop reason = step in
frame #0: 0x0000555555554638 a.out`main [inlined] access(ptr="") at small.c:6:8
3
4 void access (volatile char *ptr)
5 {
-> 6 *ptr = 'x';
7 }
8
9 int main (int argc, char **argv)
$ lldb a.out
(lldb) target create "a.out"
Current executable set to '/root/a.out' (x86_64).
(lldb) b main
Breakpoint 1: where = a.out`main + 5 at small.c:14:6, address = 0x0000000000000625
(lldb) r
...
(lldb) si
Process 46322 stopped
* thread #1, name = 'a.out', stop reason = instruction step into
frame #0: 0x000055555555463d a.out`main(argc=1, argv=0x00007fffffffe4e8) at small.c:18:3
15 pc = &c;
16
17 access (pb);
-> 18 access (pc);
19
20 return 0;
21 }
(lldb) si
Process 46322 stopped
* thread #1, name = 'a.out', stop reason = instruction step into
frame #0: 0x0000555555554642 a.out`main(argc=1, argv=0x00007fffffffe4e8) at small.c:20:3
17 access (pb);
18 access (pc);
19
-> 20 return 0;
21 }
(lldb)
```
$ cat small.c
```
char *pb;
char *pc;
void access (volatile char *ptr)
{
*ptr = 'x';
}
int main (int argc, char **argv)
{
char b;
char c;
pb = &b;
pc = &c;
access (pb);
access (pc);
return 0;
}
```
We can find that when we step at source level, Line #6 can be reached in LLDB. When we step at instruction level. Line #6 is not hit in lldb.
```
$ clang --version
Ubuntu clang version 17.0.0 (++20230509063816+15a480c05efd-1~exp1~20230509183827.1226)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
$ lldb --version
lldb version 17.0.0
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsV0Gv4jYQ_jXmMiJyxklwDhxgKVKlldpDqz1WjmPAbXCQ7bDsZX975TgBAu-t9rXv0JWKUN7LzDdjz3zjGSOc03uj1JLka5JvZqLzh9Yuvwiz_6IrLdpZ1dZflqSgw5duCF0RzEA2wuxh_sse5ntwR9E0ibxpm6auQCRt50cZDyKCJXhh98qDtEp4BQQxwhAj8kNnrTIe1EXJzouqUeCUB98CwQXBrW1bT3A7GC2AIL_w4o8iI1gmT4tVcBTaRPHaKvHXqdXGQ0rYCj4flFVA2GbYaEEDFgiuIQfhr0GxVZoRtioIfgBR11Y511vRC73_FJg_LW-jJEmed-ai5FfbyuAwK7DIwPn2dFL1CF6BP1glaiDI0rC8Ece4Y4KLMQNBHuzAKuFa06udVycY4wYA2NneEhkNkced58MnK1g6SQFBLuxeErbpFxV2fyZsE40Wu_hRmeIhjGme8j5P46opAhBaAsiDsCAJW99ULGhur9mAPFVDeEV1hc8J-wnSfETIETF1WMDU4yLihezTS5CfQtonJnxweYeR95j_Klv8ndhaELZi38dB0L-FgcjZ4jnBbyYhYMopt0ijjVW-swboD0YYkHytTaONqkm-GQIPcXtL2CY0wvB9IKsgbMWvCzKYZ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