summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/lang/cpp/class_static
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2016-01-21 21:07:30 +0000
committerZachary Turner <zturner@google.com>2016-01-21 21:07:30 +0000
commit783550be6211b65de45c4c44eac339311f3ae1e2 (patch)
tree4827f9b6759311267e2f86d95c6426f76d6b6ae6 /lldb/packages/Python/lldbsuite/test/lang/cpp/class_static
parentbef81f3a70028699965700e6b77dcb8952abcc85 (diff)
downloadbcm5719-llvm-783550be6211b65de45c4c44eac339311f3ae1e2.tar.gz
bcm5719-llvm-783550be6211b65de45c4c44eac339311f3ae1e2.zip
Remove assumptions that thread 0 is always the main thread.
Starting with Windows 10, the Windows loader is itself multi-threaded, meaning that the loader spins up a few threads to do process initialization before it executes main. Windows delivers these notifications asynchronously and they can come out of order, so we can't be sure that the first thread we get a notification about is actually the zero'th thread. This patch fixes this by requesting the thread stopped at the breakpoint that was specified, rather than getting thread 0 and verifying that it is stopped at a breakpoint. Differential Revision: http://reviews.llvm.org/D16247 llvm-svn: 258432
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/lang/cpp/class_static')
-rw-r--r--lldb/packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py b/lldb/packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py
index d47d1b7dde4..9df6b123fce 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py
@@ -69,11 +69,8 @@ class StaticVariableTestCase(TestBase):
self.assertTrue(process, PROCESS_IS_VALID)
# The stop reason of the thread should be breakpoint.
- thread = process.GetThreadAtIndex(0)
- if thread.GetStopReason() != lldb.eStopReasonBreakpoint:
- from lldbsuite.test.lldbutil import stop_reason_to_str
- self.fail(STOPPED_DUE_TO_BREAKPOINT_WITH_STOP_REASON_AS %
- stop_reason_to_str(thread.GetStopReason()))
+ thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint)
+ self.assertIsNotNone(thread)
# Get the SBValue of 'A::g_points' and 'g_points'.
frame = thread.GetFrameAtIndex(0)
OpenPOWER on IntegriCloud