From 0bab7bf9f4165ed2d4c3095033e1becd44664b98 Mon Sep 17 00:00:00 2001 From: Kuba Brecka Date: Tue, 5 Apr 2016 13:57:42 +0000 Subject: [PATCH] Fix ThreadSanitizer test cases to work on OS X 10.10 and older. llvm-svn: 265395 --- .../lldbsuite/test/functionalities/tsan/basic/TestTsanBasic.py | 5 +++++ .../test/functionalities/tsan/thread_leak/TestTsanThreadLeak.py | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/tsan/basic/TestTsanBasic.py b/lldb/packages/Python/lldbsuite/test/functionalities/tsan/basic/TestTsanBasic.py index 999d268..5136044 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/tsan/basic/TestTsanBasic.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/tsan/basic/TestTsanBasic.py @@ -35,6 +35,11 @@ class TsanBasicTestCase(TestBase): self.runCmd("run") + stop_reason = self.dbg.GetSelectedTarget().process.GetSelectedThread().GetStopReason() + if stop_reason == lldb.eStopReasonExec: + # On OS X 10.10 and older, we need to re-exec to enable interceptors. + self.runCmd("continue") + # the stop reason of the thread should be breakpoint. self.expect("thread list", "A data race should be detected", substrs = ['stopped', 'stop reason = Data race detected']) diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/tsan/thread_leak/TestTsanThreadLeak.py b/lldb/packages/Python/lldbsuite/test/functionalities/tsan/thread_leak/TestTsanThreadLeak.py index ec13e85..1b14600 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/tsan/thread_leak/TestTsanThreadLeak.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/tsan/thread_leak/TestTsanThreadLeak.py @@ -28,6 +28,11 @@ class TsanThreadLeakTestCase(TestBase): self.runCmd("run") + stop_reason = self.dbg.GetSelectedTarget().process.GetSelectedThread().GetStopReason() + if stop_reason == lldb.eStopReasonExec: + # On OS X 10.10 and older, we need to re-exec to enable interceptors. + self.runCmd("continue") + # the stop reason of the thread should be breakpoint. self.expect("thread list", "A thread leak should be detected", substrs = ['stopped', 'stop reason = Thread leak detected']) -- 2.7.4