From e1c159e86ac2f109d0d4d9342721ce78532660cf Mon Sep 17 00:00:00 2001 From: Michal Gorny Date: Thu, 25 Jul 2019 20:27:40 +0000 Subject: [PATCH] [lldb] [Process/NetBSD] Report stopped process on SIGSTOP Mark the process as stopped when SIGSTOP arrives. This is necessary for lldb-server to generate correct response to 'process interrupt', and therefore to prevent the whole stack crashing when process is stopped. Thanks to Pavel Labath for the tip. Differential Revision: https://reviews.llvm.org/D65289 llvm-svn: 367047 --- .../expression_command/call-restarts/TestCallThatRestarts.py | 1 - .../test/expression_command/timeout/TestCallWithTimeout.py | 1 - .../lldbsuite/test/functionalities/signal/TestSendSignal.py | 1 - .../test/functionalities/thread/state/TestThreadStates.py | 1 - .../test/tools/lldb-vscode/launch/TestVSCode_launch.py | 2 -- lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp | 1 + 6 files changed, 1 insertion(+), 6 deletions(-) diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py b/lldb/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py index 235ce74fe81e..1182b156e80c 100644 --- a/lldb/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py +++ b/lldb/packages/Python/lldbsuite/test/expression_command/call-restarts/TestCallThatRestarts.py @@ -26,7 +26,6 @@ class ExprCommandThatRestartsTestCase(TestBase): @skipIfFreeBSD # llvm.org/pr19246: intermittent failure @skipIfDarwin # llvm.org/pr19246: intermittent failure @skipIfWindows # Test relies on signals, unsupported on Windows - @expectedFailureNetBSD @expectedFlakeyAndroid(bugnumber="llvm.org/pr19246") def test(self): """Test calling function that hits a signal and restarts.""" diff --git a/lldb/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py b/lldb/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py index f5c55998cd9f..7862477001ea 100644 --- a/lldb/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py +++ b/lldb/packages/Python/lldbsuite/test/expression_command/timeout/TestCallWithTimeout.py @@ -27,7 +27,6 @@ class ExprCommandWithTimeoutsTestCase(TestBase): oslist=[ "windows"], bugnumber="llvm.org/pr21765") - @expectedFailureNetBSD def test(self): """Test calling std::String member function.""" self.build() diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py b/lldb/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py index cda69f70cd26..316233b909e7 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py @@ -26,7 +26,6 @@ class SendSignalTestCase(TestBase): oslist=['freebsd'], bugnumber="llvm.org/pr23318: does not report running state") @skipIfWindows # Windows does not support signals - @expectedFailureNetBSD def test_with_run_command(self): """Test that lldb command 'process signal SIGUSR1' sends a signal to the inferior process.""" self.build() diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py b/lldb/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py index 5d384872330c..be699362aaa3 100644 --- a/lldb/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py +++ b/lldb/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py @@ -194,7 +194,6 @@ class ThreadStateTestCase(TestBase): oslist=["windows"], bugnumber="llvm.org/pr24668: Breakpoints not resolved correctly") @skipIfDarwin # llvm.org/pr15824 thread states not properly maintained and - @expectedFailureNetBSD @no_debug_info_test def test_process_interrupt(self): """Test process interrupt and continue.""" diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py index 2927ac3ba1c7..5c996fbee45c 100644 --- a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py +++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py @@ -61,7 +61,6 @@ class TestVSCode_launch(lldbvscode_testcase.VSCodeTestCaseBase): @skipIfWindows @skipIfDarwin # Skip this test for now until we can figure out why tings aren't working on build bots - @expectedFailureNetBSD @no_debug_info_test def test_cwd(self): ''' @@ -90,7 +89,6 @@ class TestVSCode_launch(lldbvscode_testcase.VSCodeTestCaseBase): @skipIfWindows @skipIfDarwin # Skip this test for now until we can figure out why tings aren't working on build bots - @expectedFailureNetBSD @no_debug_info_test def test_debuggerRoot(self): ''' diff --git a/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp b/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp index ecba338d26fc..edadfa36f851 100644 --- a/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp +++ b/lldb/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp @@ -195,6 +195,7 @@ void NativeProcessNetBSD::MonitorSIGSTOP(lldb::pid_t pid) { SIGSTOP, &info.psi_siginfo); } } + SetState(StateType::eStateStopped, true); } }