[lldb-dev] [Bug 36156] New: lldb-mi does not report watchpoint stops

via lldb-dev lldb-dev at lists.llvm.org
Tue Jan 30 13:15:46 PST 2018


https://bugs.llvm.org/show_bug.cgi?id=36156

            Bug ID: 36156
           Summary: lldb-mi does not report watchpoint stops
           Product: lldb
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at lists.llvm.org
          Reporter: ted.woodward at codeaurora.org
                CC: llvm-bugs at lists.llvm.org

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***
>bin/lldb-mi foo
(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)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20180130/0b924299/attachment.html>


More information about the lldb-dev mailing list