diff options
author | Jim Ingham <jingham@apple.com> | 2017-12-05 02:50:45 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2017-12-05 02:50:45 +0000 |
commit | ba205c1b76ff72f383dc82ffe9f6f1fc2d6b362a (patch) | |
tree | b86a0011f3ddd3224b40e84edaefa22de28985b2 /lldb/packages/Python/lldbsuite | |
parent | 45816d6b917c27a55230ba096067c64797ccbbe9 (diff) | |
download | bcm5719-llvm-ba205c1b76ff72f383dc82ffe9f6f1fc2d6b362a.tar.gz bcm5719-llvm-ba205c1b76ff72f383dc82ffe9f6f1fc2d6b362a.zip |
Add target.process.stop-on-exec setting, and obey it.
Also add a test. There should also be control for this
in ProcessLaunchInfo and a "target launch" flag, but at least
this will allow you to control it somehow.
<rdar://problem/35842137>
llvm-svn: 319731
Diffstat (limited to 'lldb/packages/Python/lldbsuite')
-rw-r--r-- | lldb/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py | 44 |
1 files changed, 32 insertions, 12 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py b/lldb/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py index fcab7bba6e2..e162429de8d 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py @@ -29,7 +29,16 @@ class ExecTestCase(TestBase): @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(self): + 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") @@ -60,6 +69,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, @@ -84,17 +103,18 @@ 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") - - 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() + 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.") + + # Run and we should stop at breakpoint in main after exec + process.Continue() threads = lldbutil.get_threads_stopped_at_breakpoint( process, breakpoint) |