[NativeProcessLinux] Fix handling of SIGSTOP
authorPavel Labath <labath@google.com>
Thu, 21 May 2015 08:32:18 +0000 (08:32 +0000)
committerPavel Labath <labath@google.com>
Thu, 21 May 2015 08:32:18 +0000 (08:32 +0000)
commit39036ac31d1571372a58ceb0044f9867ec3f499e
tree5d8ae94a0ad97e2554870a32871caf87d30d7d0a
parent7a228ff4397195c5128f08763da36c3939e2cabb
[NativeProcessLinux] Fix handling of SIGSTOP

Summary:
Previously, NPL tried to reinject SIGSTOP into the inferior in an attempt to get the process to
start in the group-stop state. This was:
a) wrong (reinjection should be controlled by "process handle" lldb setting)
b) racy (it should use Resume for transparent resuming instead of RequestResume)
c) broken (llgs crashed on inferior SIGSTOP)

With this change, SIGSTOP is handled just like any other signal delivered to the inferior: we
stop all threads and report signal reception to lldb. SIGSTOP reinjection does not behave the
same way as it would outside the debugger, but simulating this is a hard problem and is not
normally necessary.

Test Plan: I have added a test which verifies we get SIGSTOP reports and we do not crash.

Reviewers: ovyalov, chaoren

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D9852

llvm-svn: 237880
lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
lldb/test/functionalities/signal/raise/Makefile [new file with mode: 0644]
lldb/test/functionalities/signal/raise/TestRaise.py [new file with mode: 0644]
lldb/test/functionalities/signal/raise/main.c [new file with mode: 0644]