[llvm-bugs] [Bug 30789] New: Watchpoint::SetEnabled & therefore SBWatchpoint::SetEnabled don't actually disable a watchpoint

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Oct 25 13:43:30 PDT 2016


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

            Bug ID: 30789
           Summary: Watchpoint::SetEnabled & therefore
                    SBWatchpoint::SetEnabled don't actually disable a
                    watchpoint
           Product: lldb
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: lldb-dev at lists.llvm.org
          Reporter: jingham at apple.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

This is on MacOS x86_64:

Build the test case in functionalities/watchpoint/watchpoint_command/command
and do:

(lldb) b s -p "Set break"
Breakpoint 2: where = a.out`main + 63 at main.cpp:22, address =
0x0000000100000ecf
(lldb) run
Process 98597 launched: 'a.out' (x86_64)
&global=0x100001018
Process 98597 stopped
* thread #1: tid = 0x1740788, function: main , stop reason = breakpoint 2.1
    frame #0: 0x0000000100000ecf a.out`main at main.cpp:22
   19      int main(int argc, char** argv) {
   20          int local = 0;
   21          printf("&global=%p\n", &global);
-> 22          printf("about to write to 'global'...\n"); // Set break point at
this line.
   23          for (int i = 0; i < 10; ++i)
   24              modify(global);
   25      
(lldb) watch set variable global
Watchpoint created: Watchpoint 1: addr = 0x100001018 size = 4 state = enabled
type = w
    declare @ 'main.cpp:12'
    watchpoint spec = 'global'
    new value: 0
(lldb) c
Process 98597 resuming
about to write to 'global'...

Watchpoint 1 hit:
old value: 0
new value: 1
Process 98597 stopped
* thread #1: tid = 0x1740788, function: modify(int&) , stop reason = watchpoint
1
    frame #0: 0x0000000100000f53 a.out`modify(int&) at main.cpp:17
   14      
   15      static void modify(int32_t &var) {
   16          ++var;
-> 17      }
   18      
   19      int main(int argc, char** argv) {
   20          int local = 0;
(lldb) script lldb.target.FindWatchpointByID(1).SetEnabled(False)
(lldb) watch list
Number of supported hardware watchpoints: 4
Current watchpoints:
Watchpoint 1: addr = 0x100001018 size = 4 state = disabled type = w
    declare @ 'main.cpp:12'
    watchpoint spec = 'global'
    old value: 0
    new value: 1
(lldb) c
Process 98597 resuming
Process 98597 stopped
* thread #1: tid = 0x1740788, function: modify(int&) , stop reason =
EXC_BREAKPOINT (code=EXC_I386_SGL, subcode=0x100001018)
    frame #0: 0x0000000100000f53 a.out`modify(int&) at main.cpp:17
   14      
   15      static void modify(int32_t &var) {
   16          ++var;
-> 17      }
   18      
   19      int main(int argc, char** argv) {
   20          int local = 0;

So the watchpoint says it was disabled, but it actually didn't get disabled,
and we hit it on continue.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20161025/453297c2/attachment.html>


More information about the llvm-bugs mailing list