aboutsummaryrefslogtreecommitdiff
path: root/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/Python/lldbsuite/test/functionalities/exec/TestExec.py')
-rw-r--r--packages/Python/lldbsuite/test/functionalities/exec/TestExec.py50
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 65271c3894b8..965af3e4910a 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.")