[Lldb-commits] [PATCH] Fix debuggee termination from ProcessPOSIX::DoDestroy
Ed Maste
emaste at freebsd.org
Tue Apr 1 07:43:37 PDT 2014
Rebase after committing the FreeBSD side of the change
Hi tfiala,
http://llvm-reviews.chandlerc.com/D3159
CHANGE SINCE LAST DIFF
http://llvm-reviews.chandlerc.com/D3159?vs=8136&id=8270#toc
Files:
source/Plugins/Process/Linux/ProcessMonitor.cpp
source/Plugins/Process/Linux/ProcessMonitor.h
source/Plugins/Process/POSIX/ProcessPOSIX.cpp
Index: source/Plugins/Process/Linux/ProcessMonitor.cpp
===================================================================
--- source/Plugins/Process/Linux/ProcessMonitor.cpp
+++ source/Plugins/Process/Linux/ProcessMonitor.cpp
@@ -904,31 +904,6 @@
}
//------------------------------------------------------------------------------
-/// @class KillOperation
-/// @brief Implements ProcessMonitor::BringProcessIntoLimbo.
-class KillOperation : public Operation
-{
-public:
- KillOperation(bool &result) : m_result(result) { }
-
- void Execute(ProcessMonitor *monitor);
-
-private:
- bool &m_result;
-};
-
-void
-KillOperation::Execute(ProcessMonitor *monitor)
-{
- lldb::pid_t pid = monitor->GetPID();
-
- if (PTRACE(PTRACE_KILL, pid, NULL, NULL, 0))
- m_result = false;
- else
- m_result = true;
-}
-
-//------------------------------------------------------------------------------
/// @class DetachOperation
/// @brief Implements ProcessMonitor::Detach.
class DetachOperation : public Operation
@@ -2229,12 +2204,9 @@
}
bool
-ProcessMonitor::BringProcessIntoLimbo()
+ProcessMonitor::Kill()
{
- bool result;
- KillOperation op(result);
- DoOperation(&op);
- return result;
+ return kill(GetPID(), SIGKILL) == 0;
}
bool
Index: source/Plugins/Process/Linux/ProcessMonitor.h
===================================================================
--- source/Plugins/Process/Linux/ProcessMonitor.h
+++ source/Plugins/Process/Linux/ProcessMonitor.h
@@ -172,11 +172,9 @@
bool
SingleStep(lldb::tid_t tid, uint32_t signo);
- /// Sends the inferior process a PTRACE_KILL signal. The inferior will
- /// still exists and can be interrogated. Once resumed it will exit as
- /// though it received a SIGKILL.
+ /// Terminate the traced process.
bool
- BringProcessIntoLimbo();
+ Kill();
lldb_private::Error
Detach(lldb::tid_t tid);
Index: source/Plugins/Process/POSIX/ProcessPOSIX.cpp
===================================================================
--- source/Plugins/Process/POSIX/ProcessPOSIX.cpp
+++ source/Plugins/Process/POSIX/ProcessPOSIX.cpp
@@ -339,11 +339,7 @@
{
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;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D3159.3.patch
Type: text/x-patch
Size: 2466 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20140401/07984174/attachment.bin>
More information about the lldb-commits
mailing list