diff options
author | Oleksiy Vyalov <ovyalov@google.com> | 2016-04-09 03:08:02 +0000 |
---|---|---|
committer | Oleksiy Vyalov <ovyalov@google.com> | 2016-04-09 03:08:02 +0000 |
commit | d8bcf3a74be19b6795f477bd51e15237a55af533 (patch) | |
tree | be279f743b806e580922e20b423d489748c05fca /lldb/packages/Python/lldbsuite/test | |
parent | 8383912f8700297a7cc6d5be7e8bbaed71057067 (diff) | |
download | bcm5719-llvm-d8bcf3a74be19b6795f477bd51e15237a55af533.tar.gz bcm5719-llvm-d8bcf3a74be19b6795f477bd51e15237a55af533.zip |
Fix TestBreakpointSetRestart failure on Android.
llvm-svn: 265869
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py index 8c4af58744e..4ca93765b65 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py @@ -5,7 +5,6 @@ Test inferior restart when breakpoint is set on running target. 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 |