diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:50:09 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:50:09 +0000 |
| commit | f3fbd1c0586ff6ec7895991e6c28f61a503c36a8 (patch) | |
| tree | 48d008fd3df8c0e73271a4b18474e0aac6dbfe33 /packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads | |
| parent | 2fc5d2d1dfaf623ce4e24cd8590565902f8c557c (diff) | |
Notes
Diffstat (limited to 'packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads')
2 files changed, 7 insertions, 16 deletions
diff --git a/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py b/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py index 2318214a0d5c..af8306c9a20e 100644 --- a/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py +++ b/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py @@ -9,15 +9,16 @@ from __future__ import print_function import os, time import re import lldb +from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * -import lldbsuite.test.lldbutil as lldbutil +from lldbsuite.test import lldbutil class WatchpointForMultipleThreadsTestCase(TestBase): mydir = TestBase.compute_mydir(__file__) @expectedFailureAndroid(archs=['arm', 'aarch64']) # Watchpoints not supported - @expectedFailureWindows("llvm.org/pr24446") # WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows + @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows") def test_watchpoint_multiple_threads(self): """Test that lldb watchpoint works for multiple threads.""" self.build() @@ -25,7 +26,7 @@ class WatchpointForMultipleThreadsTestCase(TestBase): self.hello_multiple_threads() @expectedFailureAndroid(archs=['arm', 'aarch64']) # Watchpoints not supported - @expectedFailureWindows("llvm.org/pr24446") # WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows + @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows") def test_watchpoint_multiple_threads_wp_set_and_then_delete(self): """Test that lldb watchpoint works for multiple threads, and after the watchpoint is deleted, the watchpoint event should no longer fires.""" self.build() @@ -57,9 +58,6 @@ class WatchpointForMultipleThreadsTestCase(TestBase): 'stop reason = breakpoint']) # Now let's set a write-type watchpoint for variable 'g_val'. - # The main.cpp, by design, misbehaves by not following the agreed upon - # protocol of using a mutex while accessing the global pool and by not - # writing to the variable. self.expect("watchpoint set variable -w write g_val", WATCHPOINT_CREATED, substrs = ['Watchpoint created', 'size = 4', 'type = w']) @@ -101,9 +99,6 @@ class WatchpointForMultipleThreadsTestCase(TestBase): 'stop reason = breakpoint']) # Now let's set a write-type watchpoint for variable 'g_val'. - # The main.cpp, by design, misbehaves by not following the agreed upon - # protocol of using a mutex while accessing the global pool and by not - # writing to the variable. self.expect("watchpoint set variable -w write g_val", WATCHPOINT_CREATED, substrs = ['Watchpoint created', 'size = 4', 'type = w']) diff --git a/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/main.cpp b/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/main.cpp index 8a31041f8fca..7f2e5e6e6cb5 100644 --- a/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/main.cpp +++ b/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/main.cpp @@ -23,8 +23,7 @@ uint32_t access_pool (bool flag = false) { static std::mutex g_access_mutex; - if (!flag) - g_access_mutex.lock(); + g_access_mutex.lock(); uint32_t old_val = g_val; if (flag) @@ -33,17 +32,14 @@ access_pool (bool flag = false) g_val = old_val + 1; } - if (!flag) - g_access_mutex.unlock(); + g_access_mutex.unlock(); return g_val; } void thread_func (uint32_t thread_index) { - // Break here in order to allow the thread - // to inherit the global watchpoint state. - printf ("%s (thread index = %u) startng...\n", __FUNCTION__, thread_index); + printf ("%s (thread index = %u) starting...\n", __FUNCTION__, thread_index); uint32_t count = 0; uint32_t val; |
