[Lldb-commits] [lldb] r257946 - Fix TestDebugBreak.py.

Zachary Turner via lldb-commits lldb-commits at lists.llvm.org
Fri Jan 15 14:22:40 PST 2016


Author: zturner
Date: Fri Jan 15 16:22:40 2016
New Revision: 257946

URL: http://llvm.org/viewvc/llvm-project?rev=257946&view=rev
Log:
Fix TestDebugBreak.py.

We can't assume that the main thread of an inferior has index 0,
even in a single-threaded app.

Modified:
    lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/TestDebugBreak.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/TestDebugBreak.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/TestDebugBreak.py?rev=257946&r1=257945&r2=257946&view=diff
==============================================================================
--- lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/TestDebugBreak.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/TestDebugBreak.py Fri Jan 15 16:22:40 2016
@@ -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')




More information about the lldb-commits mailing list