From a11668e87b9096c821ee9fd213e398e909b92965 Mon Sep 17 00:00:00 2001 From: Tatyana Krasnukha Date: Thu, 26 Sep 2019 10:57:11 +0000 Subject: Don't stop execution in batch mode when process stops with SIGINT or SIGSTOP Summary: Usually, SIGINT and SIGSTOP don't imply a crash, e.g. SIGSTOP is sent on process launch and attach on some platforms. Differential Revision: https://reviews.llvm.org/D67776 llvm-svn: 372961 --- .../test/driver/batch_mode/TestBatchMode.py | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'lldb/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py') diff --git a/lldb/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py b/lldb/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py index 01e11fc096c..41c6019adfb 100644 --- a/lldb/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py +++ b/lldb/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py @@ -78,6 +78,35 @@ class DriverBatchModeTest(PExpectTest): import pexpect child.expect(pexpect.EOF) + @expectedFlakeyFreeBSD("llvm.org/pr25172 fails rarely on the buildbot") + def test_batch_mode_launch_stop_at_entry(self): + """Test that the lldb driver's batch mode works correctly for process launch.""" + self.build() + + exe = self.getBuildArtifact("a.out") + + # Launch with the option '--stop-at-entry' stops with a signal (usually SIGSTOP) + # that should be suppressed since it doesn't imply a crash and + # this is not a reason to exit batch mode. + extra_args = ['-b', + '-o', 'process launch --stop-at-entry', + '-o', 'continue', + ] + self.launch(executable=exe, extra_args=extra_args) + child = self.child + + # Check that the process has been launched: + child.expect("Process ([0-9]+) launched:") + # We should have continued: + child.expect_exact("continue") + # The App should have not have crashed: + child.expect_exact("Got there on time and it did not crash.") + + # Then lldb should exit. + child.expect_exact("exited") + import pexpect + child.expect(pexpect.EOF) + def closeVictim(self): if self.victim is not None: self.victim.close() -- cgit v1.2.3