<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 abort() function within a nested for loop"
href="https://bugs.llvm.org/show_bug.cgi?id=45609">45609</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>lldb wrongly stopped at abort() function within a nested for loop
</td>
</tr>
<tr>
<th>Product</th>
<td>lldb
</td>
</tr>
<tr>
<th>Version</th>
<td>9.0
</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 9.0.1
$ clang -g small.c; lldb ./a.out
(lldb) target create "./a.out"
Current executable set to './a.out' (x86_64).
(lldb) b small.c:5
Breakpoint 1: where = a.out`main + 49 at small.c:5:12, address =
0x0000000000001171
(lldb) run
Process 45684 launched: '/home/yibiao/cv-gcov/a.out' (x86_64)
Process 45684 stopped
* thread #1, name = 'a.out', stop reason = breakpoint 1.1
frame #0: 0x0000555555555171 a.out`main at small.c:5:12
2 {
3 for (int x = 1; x < 2; x++)
4 for (int y = -1; y <= 0; y++)
-> 5 if ((x - y) != (x - y))
6 __builtin_abort ();
7 return 0;
8 }
(lldb) step
Process 45684 stopped
* thread #1, name = 'a.out', stop reason = step in
frame #0: 0x000055555555518f a.out`main at small.c:4:31
1 int main ()
2 {
3 for (int x = 1; x < 2; x++)
-> 4 for (int y = -1; y <= 0; y++)
5 if ((x - y) != (x - y))
6 __builtin_abort ();
7 return 0;
(lldb) step
Process 45684 stopped
* thread #1, name = 'a.out', stop reason = breakpoint 1.1
frame #0: 0x0000555555555171 a.out`main at small.c:5:12
2 {
3 for (int x = 1; x < 2; x++)
4 for (int y = -1; y <= 0; y++)
-> 5 if ((x - y) != (x - y))
6 __builtin_abort ();
7 return 0;
8 }
(lldb) step
Process 45684 stopped
* thread #1, name = 'a.out', stop reason = step in
frame #0: 0x000055555555518f a.out`main at small.c:4:31
1 int main ()
2 {
3 for (int x = 1; x < 2; x++)
-> 4 for (int y = -1; y <= 0; y++)
5 if ((x - y) != (x - y))
6 __builtin_abort ();
7 return 0;
(lldb) step
Process 45684 stopped
* thread #1, name = 'a.out', stop reason = step in
frame #0: 0x000055555555519d a.out`main at small.c:6:25
3 for (int x = 1; x < 2; x++)
4 for (int y = -1; y <= 0; y++)
5 if ((x - y) != (x - y))
-> 6 __builtin_abort ();
7 return 0;
8 }
/***
In the last step, lldb stopped at __builtin_abort(); statement.
When we directly setting breakpoint at small.c:6, lld is not stopped as
follows:
***/
$ lldb ./a.out
(lldb) target create "./a.out"
Current executable set to './a.out' (x86_64).
(lldb) b small.c:6
Breakpoint 1: where = a.out`main + 69 at small.c:6:8, address =
0x0000000000001185
(lldb) run
Process 45740 launched: '/home/yibiao/cv-gcov/a.out' (x86_64)
Process 45740 exited with status = 0 (0x00000000)
$ cat small.c
int main ()
{
for (int x = 1; x < 2; x++)
for (int y = -1; y <= 0; y++)
if ((x - y) != (x - y))
__builtin_abort ();
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>