diff options
author | Jason Molenda <jmolenda@apple.com> | 2019-03-20 22:59:16 +0000 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 2019-03-20 22:59:16 +0000 |
commit | 9d760a0a76e6caec6f675bf2633c5aa7fab00f71 (patch) | |
tree | 037362dc22bef6fced5e18dc3dd4196a52a12b6e /lldb/tools/debugserver | |
parent | db5edebea266ec2377f480276423f537aeec53f4 (diff) | |
download | bcm5719-llvm-9d760a0a76e6caec6f675bf2633c5aa7fab00f71.tar.gz bcm5719-llvm-9d760a0a76e6caec6f675bf2633c5aa7fab00f71.zip |
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
Diffstat (limited to 'lldb/tools/debugserver')
-rw-r--r-- | lldb/tools/debugserver/source/MacOSX/MachProcess.mm | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lldb/tools/debugserver/source/MacOSX/MachProcess.mm b/lldb/tools/debugserver/source/MacOSX/MachProcess.mm index ca68339d782..15a347778cf 100644 --- a/lldb/tools/debugserver/source/MacOSX/MachProcess.mm +++ b/lldb/tools/debugserver/source/MacOSX/MachProcess.mm @@ -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(); |