<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - lldb wrongly stopped at a statement for nesting loop using step instruction"
href="https://bugs.llvm.org/show_bug.cgi?id=45920">45920</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>lldb wrongly stopped at a statement for nesting loop using step instruction
</td>
</tr>
<tr>
<th>Product</th>
<td>lldb
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>All Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>lldb-dev@lists.llvm.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>yangyibiao@hust.edu.cn
</td>
</tr>
<tr>
<th>CC</th>
<td>jdevlieghere@apple.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>$ lldb --version
lldb version 11.0.0
clang revision 871beba234a83a2a02da9dedbd59b91a1bfbd7af
llvm revision 871beba234a83a2a02da9dedbd59b91a1bfbd7af
$ clang --version
clang version 11.0.0 (/home/yibiao/.cache/yay/llvm-git/llvm-project
871beba234a83a2a02da9dedbd59b91a1bfbd7af)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
$ lldb a.out
(lldb) target create "a.out"
Current executable set to '/home/yibiao/Debugger/a.out' (x86_64).
(lldb) b main
Breakpoint 1: where = a.out`main + 11 at small.c:4:10, address =
0x000000000040111b
(lldb) r
Process 13529 launched: '/home/yibiao/Debugger/a.out' (x86_64)
Process 13529 stopped
* thread #1, name = 'a.out', stop reason = breakpoint 1.1
frame #0: 0x000000000040111b a.out`main at small.c:4:10
1 int main ()
2 {
3 int x, y;
-> 4 for (x = __INT_MAX__ - 1; x < __INT_MAX__; x++)
5 for (y = -1; y <= 0; y++)
6 if ((x + 1 - y) != (int) (x + 1U - y))
7 return 1;
(lldb) si -c 35
Process 13529 stopped
* thread #1, name = 'a.out', stop reason = instruction step into
frame #0: 0x000000000040113a a.out`main at small.c:5:5
2 {
3 int x, y;
4 for (x = __INT_MAX__ - 1; x < __INT_MAX__; x++)
-> 5 for (y = -1; y <= 0; y++)
6 if ((x + 1 - y) != (int) (x + 1U - y))
7 return 1;
8 return 0;
(lldb) var
(int) x = 2147483646
(int) y = 1
(lldb) si
Process 13529 stopped
* thread #1, name = 'a.out', stop reason = instruction step into
frame #0: 0x0000000000401179 a.out`main at small.c:7:16
4 for (x = __INT_MAX__ - 1; x < __INT_MAX__; x++)
5 for (y = -1; y <= 0; y++)
6 if ((x + 1 - y) != (int) (x + 1U - y))
-> 7 return 1;
8 return 0;
9 }
(lldb)
/******************************
lldb is wrongly stopped at Line 7.
However, when setting breakpoint at Line 7. The program is directly exit.
*******************************/
$ lldb a.out
(lldb) target create "a.out"
Current executable set to '/home/yibiao/Debugger/a.out' (x86_64).
(lldb) b 7
Breakpoint 1: where = a.out`main + 74 at small.c:7:9, address =
0x000000000040115a
(lldb) r
Process 13589 launched: '/home/yibiao/Debugger/a.out' (x86_64)
Process 13589 exited with status = 0 (0x00000000)
$ cat small.c
int main ()
{
int x, y;
for (x = __INT_MAX__ - 1; x < __INT_MAX__; x++)
for (y = -1; y <= 0; y++)
if ((x + 1 - y) != (int) (x + 1U - y))
return 1;
return 0;
}</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>