1""" 2Test lldb's handling of job control signals (SIGTSTP, SIGCONT). 3""" 4 5from lldbsuite.test.decorators import * 6from lldbsuite.test.lldbtest import * 7from lldbsuite.test.lldbpexpect import PExpectTest 8 9 10class JobControlTest(PExpectTest): 11 12 mydir = TestBase.compute_mydir(__file__) 13 14 @skipIf(oslist=["linux"], archs=["arm", "aarch64"]) 15 def test_job_control(self): 16 def post_spawn(): 17 self.child.expect("PID=([0-9]+)") 18 self.lldb_pid = int(self.child.match[1]) 19 20 run_under = [sys.executable, self.getSourcePath('shell.py')] 21 self.launch(run_under=run_under, post_spawn=post_spawn) 22 23 os.kill(self.lldb_pid, signal.SIGTSTP) 24 self.child.expect("STATUS=([0-9]+)") 25 status = int(self.child.match[1]) 26 27 self.assertTrue(os.WIFSTOPPED(status)) 28 self.assertEquals(os.WSTOPSIG(status), signal.SIGTSTP) 29 30 os.kill(self.lldb_pid, signal.SIGCONT) 31 32 self.child.sendline("quit") 33 self.child.expect("RETURNCODE=0") 34