Author: ovyalov Date: Fri Apr 8 22:08:02 2016 New Revision: 265869 URL: http://llvm.org/viewvc/llvm-project?rev=265869&view=rev Log: Fix TestBreakpointSetRestart failure on Android.
Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py Modified: lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py?rev=265869&r1=265868&r2=265869&view=diff ============================================================================== --- lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py (original) +++ lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py Fri Apr 8 22:08:02 2016 @@ -5,7 +5,6 @@ Test inferior restart when breakpoint is import os import lldb from lldbsuite.test.lldbtest import * -from lldbsuite.test import lldbutil class BreakpointSetRestart(TestBase): @@ -15,19 +14,26 @@ class BreakpointSetRestart(TestBase): def test_breakpoint_set_restart(self): self.build() - cwd = self.get_process_working_directory() - exe = os.path.join(cwd, "a.out") + cwd = os.getcwd() + exe = os.path.join(cwd, 'a.out') + target = self.dbg.CreateTarget(exe) + self.assertTrue(target, VALID_TARGET) self.dbg.SetAsync(True) - process = target.LaunchSimple(None, None, cwd) + process = target.LaunchSimple(None, None, self.get_process_working_directory()) + self.assertTrue(process, PROCESS_IS_VALID) - lldbutil.expect_state_changes(self, self.dbg.GetListener(), [lldb.eStateRunning]) + event = lldb.SBEvent() + # Wait for inferior to transition to running state + while self.dbg.GetListener().WaitForEvent(2, event): + if lldb.SBProcess.GetStateFromEvent(event) == lldb.eStateRunning: + break + bp = target.BreakpointCreateBySourceRegex(self.BREAKPOINT_TEXT, lldb.SBFileSpec(os.path.join(cwd, 'main.cpp'))) self.assertTrue(bp.IsValid() and bp.GetNumLocations() == 1, VALID_BREAKPOINT) - event = lldb.SBEvent() while self.dbg.GetListener().WaitForEvent(2, event): if lldb.SBProcess.GetStateFromEvent(event) == lldb.eStateStopped and lldb.SBProcess.GetRestartedFromEvent(event): continue _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits