<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </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 --- - "Step" doesn't stop with conditional breakpoint on the next line"
   href="https://llvm.org/bugs/show_bug.cgi?id=30863">30863</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>"Step" doesn't stop with conditional breakpoint on the next line
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>lldb
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.9
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </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>eldar.abusalimov@jetbrains.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Extracted from <a href="https://youtrack.jetbrains.com/issue/CPP-7986">https://youtrack.jetbrains.com/issue/CPP-7986</a> Conditional Break
Point

To see the issue, set a Conditional Break at each of the comments tagged `CB`
with the expressions to the right of the colon.

Note that the second CB is not going to be hit naturally since `i` never
changes to 2, this is correct. When the first breakpoint is hit, use `step` to
attempt to move to the next line. It should maintain the debug mode and wait
for more instructions on the next line, but instead it checks the CB and
notices that it is not true and continues until the break point on the return
statement.


```
#include <stdio.h>

int main() {
    int i = 1;

    printf("i: %d", i);  // CB: i == 1 // true
    printf("i: %d", i);  // CB: i == 2 // false

    return 0;
}
```

Debug session:

```
$ lldb hello
(lldb) target create "hello"
Current executable set to 'hello' (x86_64).
(lldb) br s -f main.c -l 6 -c 'i == 1'
Breakpoint 1: where = hello`main + 15 at main.c:6, address = 0x0000000000400535
(lldb) br s -f main.c -l 7 -c 'i == 2'
Breakpoint 2: where = hello`main + 35 at main.c:7, address = 0x0000000000400549
(lldb) r
Process 9877 launched: '/home/mint/ClionProjects/hello/cmake-build-debug/hello'
(x86_64)
Process 9877 stopped
* thread #1: tid = 9877, 0x0000000000400535 hello`main + 15 at main.c:6, name =
'hello', stop reason = breakpoint 1.1
    frame #0: 0x0000000000400535 hello`main + 15 at main.c:6
   3       int main() {
   4           int i = 1;
   5       
-> 6           printf("i: %d", i);
   7           printf("i: %d", i);
   8       
   9           return 0;
(lldb) s
Process 9877 exited with status = 0 (0x00000000) 
(lldb)  
```

Everything works fine in case the condition of the second breakpoint evaluates
to `true`.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>