diff options
Diffstat (limited to 'lldb')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py | 16 | ||||
-rw-r--r-- | lldb/source/API/SBWatchpoint.cpp | 2 |
2 files changed, 12 insertions, 6 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py index fdeb4b8fa3b..f8435befae5 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py @@ -64,17 +64,23 @@ class TestWatchpointEvents (TestBase): if not error.Success(): self.fail ("Failed to make watchpoint for local_var: %s"%(error.GetCString())) - self.GetWatchpointEvent (lldb.eWatchpointEventTypeAdded) + self.GetWatchpointEvent(lldb.eWatchpointEventTypeAdded) # Now change some of the features of this watchpoint and make sure we get events: local_watch.SetEnabled(False) - self.GetWatchpointEvent (lldb.eWatchpointEventTypeDisabled) + self.GetWatchpointEvent(lldb.eWatchpointEventTypeDisabled) + + local_watch.SetEnabled(True) + self.GetWatchpointEvent(lldb.eWatchpointEventTypeEnabled) local_watch.SetIgnoreCount(10) - self.GetWatchpointEvent (lldb.eWatchpointEventTypeIgnoreChanged) + self.GetWatchpointEvent(lldb.eWatchpointEventTypeIgnoreChanged) - local_watch.SetCondition ("1 == 2") - self.GetWatchpointEvent (lldb.eWatchpointEventTypeConditionChanged) + condition = "1 == 2" + local_watch.SetCondition(condition) + self.GetWatchpointEvent(lldb.eWatchpointEventTypeConditionChanged) + self.assertTrue(local_watch.GetCondition() == condition, 'make sure watchpoint condition is "' + condition + '"'); + def GetWatchpointEvent (self, event_type): # We added a watchpoint so we should get a watchpoint added event. event = lldb.SBEvent() diff --git a/lldb/source/API/SBWatchpoint.cpp b/lldb/source/API/SBWatchpoint.cpp index c33d5686b9c..1c88a58191e 100644 --- a/lldb/source/API/SBWatchpoint.cpp +++ b/lldb/source/API/SBWatchpoint.cpp @@ -159,7 +159,7 @@ SBWatchpoint::SetEnabled (bool enabled) if (watchpoint_sp) { std::lock_guard<std::recursive_mutex> guard(watchpoint_sp->GetTarget().GetAPIMutex()); - watchpoint_sp->GetTarget().DisableWatchpointByID(watchpoint_sp->GetID()); + watchpoint_sp->SetEnabled(enabled); } } |