From 783550be6211b65de45c4c44eac339311f3ae1e2 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Thu, 21 Jan 2016 21:07:30 +0000 Subject: 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 --- lldb/packages/Python/lldbsuite/test/python_api/sbdata/TestSBData.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lldb/packages/Python/lldbsuite/test/python_api/sbdata/TestSBData.py') diff --git a/lldb/packages/Python/lldbsuite/test/python_api/sbdata/TestSBData.py b/lldb/packages/Python/lldbsuite/test/python_api/sbdata/TestSBData.py index 2ff516e10d8..4bb2b3b41be 100644 --- a/lldb/packages/Python/lldbsuite/test/python_api/sbdata/TestSBData.py +++ b/lldb/packages/Python/lldbsuite/test/python_api/sbdata/TestSBData.py @@ -38,8 +38,9 @@ class SBDataAPICase(TestBase): target = self.dbg.GetSelectedTarget() process = target.GetProcess() - - thread = process.GetThreadAtIndex(0) + + thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint) + self.assertIsNotNone(thread) frame = thread.GetSelectedFrame() if self.TraceOn(): -- cgit v1.2.3