diff options
author | Jim Ingham <jingham@apple.com> | 2016-11-01 20:37:02 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2016-11-01 20:37:02 +0000 |
commit | 306b62b4aed8631b585fe0ee4f0532ca7ac53c37 (patch) | |
tree | a0c9bd0e70e25b9c50348c7eccfce87394aad218 /lldb/packages/Python/lldbsuite/test | |
parent | f77a9889c08124dbf27d883100008f3b1c09962b (diff) | |
download | bcm5719-llvm-306b62b4aed8631b585fe0ee4f0532ca7ac53c37.tar.gz bcm5719-llvm-306b62b4aed8631b585fe0ee4f0532ca7ac53c37.zip |
Switch SBWatchpoint::SetEnabled over to using Process::{Enable,Disable}Watchpoint.
We don't have a good story for what happens to watchpoints when you don't
have a process, or if your process exits. Clearing that up will instruct
how to fix this for real.
Also added a test to make sure disable->enable works as well.
This resolves llvm.org/pr30789.
llvm-svn: 285742
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
2 files changed, 19 insertions, 5 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_disable/TestWatchpointDisable.py b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_disable/TestWatchpointDisable.py index a18cbe2dab4..aac001e9db5 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_disable/TestWatchpointDisable.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_disable/TestWatchpointDisable.py @@ -21,13 +21,21 @@ class TestWatchpointSetEnable(TestBase): @expectedFailureAll( oslist=["windows"], bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows") - @expectedFailureAll(bugnumber="llvm.org/pr30789, <rdar://problem/28944061>") def test_disable_works (self): """Set a watchpoint, disable it, and make sure it doesn't get hit.""" self.build() - self.disable_works() + self.do_test(False) - def disable_works(self): + @expectedFailureAndroid(archs=['arm', 'aarch64']) + @expectedFailureAll( + oslist=["windows"], + bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows") + def test_disable_enable_works (self): + """Set a watchpoint, disable it, and make sure it doesn't get hit.""" + self.build() + self.do_test(True) + + def do_test(self, test_enable): """Set a watchpoint, disable it and make sure it doesn't get hit.""" exe = 'a.out' @@ -69,7 +77,12 @@ class TestWatchpointSetEnable(TestBase): stop_reason = thread.GetStopReason() - self.assertEqual(stop_reason, lldb.eStopReasonWatchpoint, "We didn't stop at our watchpoint.") + self.assertEqual(stop_reason, lldb.eStopReasonBreakpoint, "We didn't stop at our breakpoint.") - + if test_enable: + wp.SetEnabled(True) + self.assertTrue(wp.IsEnabled(), "The watchpoint thinks it is still disabled.") + process.Continue() + stop_reason = thread.GetStopReason() + self.assertEqual(stop_reason, lldb.eStopReasonWatchpoint, "We didn't stop at our watchpoint") diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_disable/main.c b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_disable/main.c index d9192f53741..dcbc766c594 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_disable/main.c +++ b/lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_disable/main.c @@ -8,5 +8,6 @@ main() printf("Set a breakpoint here: %d.\n", global_var); global_var = 20; printf("We should have stopped on the previous line: %d.\n", global_var); + global_var = 30; return 0; } |