diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-12-18 20:12:36 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-12-18 20:12:36 +0000 |
commit | ef5d0b5e97ec8e6fa395d377b09aa7755e345b4f (patch) | |
tree | 27916256fdeeb57d10d2f3d6948be5d71a703215 /packages/Python/lldbsuite/test/functionalities/exec/TestExec.py | |
parent | 76e0736e7fcfeb179779e49c05604464b1ccd704 (diff) |
Notes
Diffstat (limited to 'packages/Python/lldbsuite/test/functionalities/exec/TestExec.py')
-rw-r--r-- | packages/Python/lldbsuite/test/functionalities/exec/TestExec.py | 50 |
1 files changed, 39 insertions, 11 deletions
diff --git a/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py b/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py index 65271c3894b8d..965af3e4910a1 100644 --- a/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py +++ b/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py @@ -24,11 +24,23 @@ def execute_command(command): class ExecTestCase(TestBase): + NO_DEBUG_INFO_TESTCASE = True + mydir = TestBase.compute_mydir(__file__) @skipUnlessDarwin @expectedFailureAll(archs=['i386'], bugnumber="rdar://28656532") - def test(self): + @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://problem/34559552") # this exec test has problems on ios systems + def test_hitting_exec (self): + self.do_test(False) + + @skipUnlessDarwin + @expectedFailureAll(archs=['i386'], bugnumber="rdar://28656532") + @expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://problem/34559552") # this exec test has problems on ios systems + def test_skipping_exec (self): + self.do_test(False) + + def do_test(self, skip_exec): if self.getArchitecture() == 'x86_64': source = os.path.join(os.getcwd(), "main.cpp") o_file = os.path.join(os.getcwd(), "main.o") @@ -59,6 +71,16 @@ class ExecTestCase(TestBase): None, None, self.get_process_working_directory()) self.assertTrue(process, PROCESS_IS_VALID) + if skip_exec: + self.debugger.HandleCommand("settings set target.process.stop-on-exec false") + def cleanup(): + self.runCmd("settings set target.process.stop-on-exec false", + check=False) + + # Execute the cleanup function during test case tear down. + self.addTearDownHook(cleanup) + + for i in range(6): # The stop reason of the thread should be breakpoint. self.assertTrue(process.GetState() == lldb.eStateStopped, @@ -83,19 +105,25 @@ class ExecTestCase(TestBase): # Run and we should stop due to exec process.Continue() - self.assertTrue(process.GetState() == lldb.eStateStopped, - "Process should be stopped at __dyld_start") + if not skip_exec: + self.assertTrue(process.GetState() == lldb.eStateStopped, + "Process should be stopped at __dyld_start") + + threads = lldbutil.get_stopped_threads( + process, lldb.eStopReasonExec) + self.assertTrue( + len(threads) == 1, + "We got a thread stopped for exec.") - threads = lldbutil.get_stopped_threads( - process, lldb.eStopReasonExec) - self.assertTrue( - len(threads) == 1, - "We got a thread stopped for exec.") - - # Run and we should stop at breakpoint in main after exec - process.Continue() + # Run and we should stop at breakpoint in main after exec + process.Continue() threads = lldbutil.get_threads_stopped_at_breakpoint( process, breakpoint) + if self.TraceOn(): + for t in process.threads: + print(t) + if t.GetStopReason() != lldb.eStopReasonBreakpoint: + self.runCmd("bt") self.assertTrue(len(threads) == 1, "Stopped at breakpoint in exec'ed process.") |