<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 - Unexpected conditional breakpoint hit"
   href="https://bugs.llvm.org/show_bug.cgi?id=36435">36435</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Unexpected conditional breakpoint hit
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>6.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>dantipov@nvidia.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=19898" name="attach_19898" title="Sample program">attachment 19898</a> <a href="attachment.cgi?id=19898&action=edit" title="Sample program">[details]</a></span>
Sample program

In GDB:

$ gdb -q t-thread3
Reading symbols from t-thread3...done.
(gdb) b f if v > 1
Breakpoint 1 at 0x400a4c: file t-thread3.cc, line 14.
(gdb) r
Starting program: /home/dantipov/tmp/t-thread3 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7ffff6edf700 (LWP 16244)]
[New Thread 0x7ffff66de700 (LWP 16245)]
[New Thread 0x7ffff5edd700 (LWP 16246)]
[New Thread 0x7ffff56dc700 (LWP 16247)]
[Switching to Thread 0x7ffff5edd700 (LWP 16246)]

Thread 4 "t-thread3" hit Breakpoint 1, f (v=2) at t-thread3.cc:14
14            g (v);
(gdb) c
Continuing.
[Switching to Thread 0x7ffff56dc700 (LWP 16247)]

Thread 5 "t-thread3" hit Breakpoint 1, f (v=3) at t-thread3.cc:14
14            g (v);
(gdb) c
Continuing.
[Switching to Thread 0x7ffff5edd700 (LWP 16246)]

Thread 4 "t-thread3" hit Breakpoint 1, f (v=2) at t-thread3.cc:14
14            g (v);
(gdb) c
Continuing.
[Switching to Thread 0x7ffff56dc700 (LWP 16247)]

Thread 5 "t-thread3" hit Breakpoint 1, f (v=3) at t-thread3.cc:14
14            g (v);
(gdb) c
Continuing.
[Switching to Thread 0x7ffff5edd700 (LWP 16246)]

Thread 4 "t-thread3" hit Breakpoint 1, f (v=2) at t-thread3.cc:14
14            g (v);
(gdb) c
Continuing.
[Switching to Thread 0x7ffff56dc700 (LWP 16247)]

Thread 5 "t-thread3" hit Breakpoint 1, f (v=3) at t-thread3.cc:14
14            g (v);
(gdb) c
Continuing.
[Switching to Thread 0x7ffff5edd700 (LWP 16246)]

Thread 4 "t-thread3" hit Breakpoint 1, f (v=2) at t-thread3.cc:14
14            g (v);

In LLDB:

$ /home/dantipov/.local/llvm-6.0.0/bin/lldb t-thread3
(lldb) target create "t-thread3"
Current executable set to 't-thread3' (x86_64).
(lldb) breakpoint set -n f -c 'v > 1'
Breakpoint 1: where = t-thread3`f(int) + 11 at t-thread3.cc:14, address =
0x0000000000400a4c
(lldb) run
Process 16274 launched: '/home/dantipov/tmp/t-thread3' (x86_64)
Process 16274 stopped
* thread #2, name = 't-thread3', stop reason = breakpoint 1.1
    frame #0: 0x0000000000400a4c t-thread3`f(v=0) at t-thread3.cc:14
   11   {
   12     while (true)
   13       {
-> 14         g (v);                                                  ;; 0 > 1
?
   15       }
   16   }
   17   
  thread #3, name = 't-thread3', stop reason = breakpoint 1.1
    frame #0: 0x0000000000400a4c t-thread3`f(v=1) at t-thread3.cc:14
   11   {
   12     while (true)
   13       {
-> 14         g (v);                                                  ;; 1 > 1
?
   15       }
   16   }
   17   
  thread #4, name = 't-thread3', stop reason = breakpoint 1.1
    frame #0: 0x0000000000400a4c t-thread3`f(v=2) at t-thread3.cc:14
   11   {
   12     while (true)
   13       {
-> 14         g (v);                                                  ;; OK
   15       }
   16   }
   17   
(lldb) process continue
Process 16274 resuming
Process 16274 stopped
* thread #2, name = 't-thread3', stop reason = breakpoint 1.1
    frame #0: 0x0000000000400a4c t-thread3`f(v=0) at t-thread3.cc:14
   11   {
   12     while (true)
   13       {
-> 14         g (v);                                                  ;; 0 > 1
?
   15       }
   16   }
   17   
  thread #3, name = 't-thread3', stop reason = breakpoint 1.1
    frame #0: 0x0000000000400a4c t-thread3`f(v=1) at t-thread3.cc:14
   11   {
   12     while (true)
   13       {
-> 14         g (v);                                                  ;; 1 > 1
?
   15       }
   16   }
   17   
  thread #4, name = 't-thread3', stop reason = breakpoint 1.1
    frame #0: 0x0000000000400a4c t-thread3`f(v=2) at t-thread3.cc:14
   11   {
   12     while (true)
   13       {
-> 14         g (v);                                                  ;; OK
   15       }
   16   }
   17</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>