Implement ProcessMonitor::Kill for Linux
authorEd Maste <emaste@freebsd.org>
Tue, 1 Apr 2014 18:14:06 +0000 (18:14 +0000)
committerEd Maste <emaste@freebsd.org>
Tue, 1 Apr 2014 18:14:06 +0000 (18:14 +0000)
commit4e0999bc22656eb8e46775114a174ba4388e8ee6
treecc8a4d6d9963431ecaa75ee2d27ff0894e25ea12
parente407ae984620f1a13bfe19a71d35123f27460b62
Implement ProcessMonitor::Kill for Linux

On FreeBSD ptrace(PT_KILL) is used to terminate the traced process
(as if PT_CONTINUE had been used with SIGKILL as the signal to be
delivered), and is the desired behaviour for ProcessPOSIX::DoDestroy.

On Linux, after ptrace(PTRACE_KILL) the traced process still exists
and can be interrogated.  It is only upon resume that it exits as though
it received SIGKILL.

As the Linux PTRACE_KILL behaviour is not used by LLDB, rename
BringProcessIntoLimbo to Kill, and change the implementation to simply
call kill() instead of using ptrace.

Thanks to Todd F for testing (Ubuntu 12.04, gcc 4.8.2).

Sponsored by: DARPA, AFRL
Differential Revision: http://llvm-reviews.chandlerc.com/D3159

llvm-svn: 205337
lldb/source/Plugins/Process/Linux/ProcessMonitor.cpp
lldb/source/Plugins/Process/Linux/ProcessMonitor.h
lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp