Change the logging on ptrace(PT_KILL) in MachProcess::Kill to log

if LOG_PROCESS is enabled or if there was an error making that call.

<rdar://problem/49036508> 

llvm-svn: 356626
This commit is contained in:
Jason Molenda 2019-03-20 22:59:16 +00:00
parent db5edebea2
commit 9d760a0a76
1 changed files with 5 additions and 3 deletions

View File

@ -1290,9 +1290,11 @@ bool MachProcess::Kill(const struct timespec *timeout_abstime) {
::ptrace(PT_KILL, m_pid, 0, 0);
DNBError err;
err.SetErrorToErrno();
DNBLogThreadedIf(LOG_PROCESS, "MachProcess::Kill() DoSIGSTOP() ::ptrace "
"(PT_KILL, pid=%u, 0, 0) => 0x%8.8x (%s)",
m_pid, err.Status(), err.AsString());
if (DNBLogCheckLogBit(LOG_PROCESS) || err.Fail()) {
err.LogThreaded("MachProcess::Kill() DoSIGSTOP() ::ptrace "
"(PT_KILL, pid=%u, 0, 0) => 0x%8.8x (%s)",
m_pid, err.Status(), err.AsString());
}
m_thread_actions = DNBThreadResumeActions(eStateRunning, 0);
PrivateResume();