From fa0b4b271a2e91204e4a2198713fd10730d72f7d Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Fri, 15 Jan 2016 22:22:40 +0000 Subject: Fix TestDebugBreak.py. We can't assume that the main thread of an inferior has index 0, even in a single-threaded app. llvm-svn: 257946 --- .../test/functionalities/breakpoint/debugbreak/TestDebugBreak.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak') diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/TestDebugBreak.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/TestDebugBreak.py index b32c970301c..45d56fe729d 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/TestDebugBreak.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/TestDebugBreak.py @@ -26,13 +26,14 @@ class DebugBreakTestCase(TestBase): # We've hit the first stop, so grab the frame. self.assertEqual(process.GetState(), lldb.eStateStopped) - thread = process.GetThreadAtIndex(0) + thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonException) + self.assertIsNotNone(thread, "Unable to find thread stopped at the __debugbreak()") frame = thread.GetFrameAtIndex(0) # We should be in funciton 'bar'. self.assertTrue(frame.IsValid()) function_name = frame.GetFunctionName() - self.assertTrue('bar' in function_name) + self.assertTrue('bar' in function_name, "Unexpected function name {}".format(function_name)) # We should be able to evaluate the parameter foo. value = frame.EvaluateExpression('*foo') -- cgit v1.2.3