commit | 5d06474b293c8a15d6e7cad60a9d55df83b19ab5 | [log] [tgz] |
---|---|---|
author | Oleksiy Vyalov <ovyalov@google.com> | Wed Nov 19 18:27:45 2014 +0000 |
committer | Oleksiy Vyalov <ovyalov@google.com> | Wed Nov 19 18:27:45 2014 +0000 |
tree | ea1f18f787becef09eef6e987cc65a56c415213e | |
parent | 4325aaa6d9101ca7dcb5a0c5523e9430ed75a437 [diff] [blame] |
Add test for denied process attach by pid and fix found bugs in Process/ProcessPOSIX.cpp and FreeBSD/ProcessMonitor. http://reviews.llvm.org/D6240 llvm-svn: 222372
diff --git a/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp b/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp index 702ff80..0e5ab5a 100644 --- a/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp +++ b/lldb/source/Plugins/Process/POSIX/ProcessPOSIX.cpp
@@ -341,6 +341,11 @@ { assert(m_monitor); m_exit_now = true; + if (GetID() == LLDB_INVALID_PROCESS_ID) + { + error.SetErrorString("invalid process id"); + return error; + } if (!m_monitor->Kill()) { error.SetErrorToErrno();