<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-mi does not report watchpoint stops"
   href="https://bugs.llvm.org/show_bug.cgi?id=36156">36156</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>lldb-mi does not report watchpoint stops
          </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>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </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>ted.woodward@codeaurora.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>When lldb-mi hits a watchpoint, the process stops, but this stop isn't
reported.

Take this simple program:

int glob = 1;

int main(void)
{
  glob = 2;
  while (1)
    ;
  return glob;
}


On Ubuntu 14.04 x86_64, I built it with clang 3.8 and debugged with lldb-mi
top-of-tree. When I run and set a watchpoint on glob, it fails to report the
stop.


***launch program, stop at main***
<span class="quote">>bin/lldb-mi foo</span >
(gdb)
-file-exec-and-symbols "foo"
^done
(gdb)
=library-loaded,id="/local/mnt/ted/tip/full/foo",target-name="/local/mnt/ted/tip/full/foo",host-name="/local/mnt/ted/tip/full/foo",symbols-loaded="0",loaded_addr="-",size="0"
b main
~"Breakpoint 1: where = foo`main + 11 at foo.c:5, address =
0x00000000004004fb\n"
^done
(gdb)
=breakpoint-created,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x00000000004004fb",func="main",file="foo.c",fullname="/local/mnt/ted/tip/full/foo.c",line="5",times="0",original-location="foo.c:5"}
(gdb)
r
~"Process 27861 launched: '/local/mnt/ted/tip/full/foo' (x86_64)\n"
^done
(gdb)
=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x00000000004004fb",func="main",file="foo.c",fullname="/local/mnt/ted/tip/full/foo.c",line="5",times="0",original-location="foo.c:5"}
(gdb)
=thread-created,id="1",group-id="i1"
=thread-selected,id="1"
(gdb)
=library-loaded,id="/local/mnt/ted/tip/full/foo",target-name="/local/mnt/ted/tip/full/foo",host-name="/local/mnt/ted/tip/full/foo",symbols-loaded="0",loaded_addr="-",size="0"
(gdb)
*running,thread-id="all"
(gdb)
(gdb)
=library-loaded,id="[vdso]",target-name="[vdso]",host-name="[vdso]",symbols-loaded="1",symbols-path="",loaded_addr="0x00007ffff7ffa000",size="0"
(gdb)
=library-loaded,id="/lib/x86_64-linux-gnu/libc.so.6",target-name="/lib/x86_64-linux-gnu/libc.so.6",host-name="/lib/x86_64-linux-gnu/libc.so.6",symbols-loaded="1",symbols-path="/usr/lib/debug/lib/x86_64-linux-gnu/libc-2.19.so",loaded_addr="-",size="0"
(gdb)
=library-loaded,id="/lib64/ld-linux-x86-64.so.2",target-name="/lib64/ld-linux-x86-64.so.2",host-name="/lib64/ld-linux-x86-64.so.2",symbols-loaded="0",loaded_addr="-",size="0"
(gdb)
=library-loaded,id="/lib/x86_64-linux-gnu/libc.so.6",target-name="/lib/x86_64-linux-gnu/libc.so.6",host-name="/lib/x86_64-linux-gnu/libc.so.6",symbols-loaded="1",symbols-path="/usr/lib/debug/lib/x86_64-linux-gnu/libc-2.19.so",loaded_addr="-",size="0"
=library-loaded,id="/lib64/ld-linux-x86-64.so.2",target-name="/lib64/ld-linux-x86-64.so.2",host-name="/lib64/ld-linux-x86-64.so.2",symbols-loaded="0",loaded_addr="-",size="0"
(gdb)
*running,thread-id="all"
(gdb)
(gdb)
*stopped,reason="breakpoint-hit",disp="del",bkptno="1",frame={level="0",addr="0x00000000004004fb",func="main",args=[],file="foo.c",fullname="/local/mnt/ted/tip/full/foo.c",line="5"},thread-id="1",stopped-threads="all"
(gdb)

***set the watchpoint and continue***
w s v glob
~"Watchpoint created: Watchpoint 1: addr = 0x00601038 size = 4 state = enabled
type = w\n    declare @ '/local/mnt/ted/tip/full/foo.c:1'\n    watchpoint spec
= 'glob'\n    new value: 1\n"
^done
(gdb)
-exec-continue
^running
(gdb)
=thread-exited,id="1",group-id="i1"
(gdb)
*running,thread-id="all"
(gdb)
=thread-created,id="1",group-id="i1"
(gdb)



lldb-mi reported thread-exited for thread 1, but the thread is still there, and
stopped at the watchpoint:

process status
~"Process 27861 stopped\n* thread #1, name = 'foo', stop reason = watchpoint
1\n    frame #0: 0x0000000000400506 foo`main at foo.c:6\n   3   \tint
main(void)\n   4   \t{\n   5   \t  glob = 2;\n-> 6   \t  \e[4mw\e[0mhile (1)\n 
 7   \t    ;\n   8   \t  return glob;\n   9   \t}\n"
^done
(gdb)</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>