summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
diff options
context:
space:
mode:
authorEd Maste <emaste@freebsd.org>2014-04-01 14:30:56 +0000
committerEd Maste <emaste@freebsd.org>2014-04-01 14:30:56 +0000
commit70882939f1eb3505829926de28a4b2063d1d4e03 (patch)
tree3861e915c9703c23122484e3835a5929990203e0 /lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
parent0feb91ef15f833c48a96e54ea9de594d7050dda5 (diff)
downloadbcm5719-llvm-70882939f1eb3505829926de28a4b2063d1d4e03.tar.gz
bcm5719-llvm-70882939f1eb3505829926de28a4b2063d1d4e03.zip
Implement ProcessMonitor::Kill for FreeBSD
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. For now I'm committing only the FreeBSD change, until the Linux change (review D3159) is successfully tested. http://llvm.org/pr18894 llvm-svn: 205315
Diffstat (limited to 'lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp')
-rw-r--r--lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp b/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
index 4ee7e3d3820..571818134d4 100644
--- a/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
+++ b/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
@@ -337,11 +337,13 @@ ProcessPOSIX::DoDestroy()
if (!HasExited())
{
- // Drive the exit event to completion (do not keep the inferior in
- // limbo).
+ assert(m_monitor);
m_exit_now = true;
-
+#ifdef __linux__
if ((m_monitor == NULL || kill(m_monitor->GetPID(), SIGKILL)) && error.Success())
+#else
+ if (!m_monitor->Kill())
+#endif
{
error.SetErrorToErrno();
return error;
OpenPOWER on IntegriCloud