diff options
author | Greg Clayton <gclayton@apple.com> | 2012-03-08 03:27:27 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2012-03-08 03:27:27 +0000 |
commit | 85f3fa5411a86e36cc9b97c2a906827b1a356ccc (patch) | |
tree | 55e7088abf019373770d6ddbb3f5cf3a79223ffe /lldb/tools/debugserver/source/MacOSX/MachException.cpp | |
parent | 5e152182a476163c61a9e6cc39fde94c489f6ef3 (diff) | |
download | bcm5719-llvm-85f3fa5411a86e36cc9b97c2a906827b1a356ccc.tar.gz bcm5719-llvm-85f3fa5411a86e36cc9b97c2a906827b1a356ccc.zip |
<rdar://problem/11007934>
On darwin, if child process of process being debugged dies due to mach exception, the debugged process will die.
debugserver now only handles the mach exceptions for the task being debugged.
llvm-svn: 152291
Diffstat (limited to 'lldb/tools/debugserver/source/MacOSX/MachException.cpp')
-rw-r--r-- | lldb/tools/debugserver/source/MacOSX/MachException.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/lldb/tools/debugserver/source/MacOSX/MachException.cpp b/lldb/tools/debugserver/source/MacOSX/MachException.cpp index 7492e9a66de..ead512ea148 100644 --- a/lldb/tools/debugserver/source/MacOSX/MachException.cpp +++ b/lldb/tools/debugserver/source/MacOSX/MachException.cpp @@ -165,12 +165,16 @@ catch_mach_exception_raise (uint64_t)(exc_data_count > 1 ? exc_data[1] : 0xBADDBADD)); } - g_message->task_port = task_port; - g_message->thread_port = thread_port; - g_message->exc_type = exc_type; - g_message->exc_data.resize(exc_data_count); - ::memcpy (&g_message->exc_data[0], exc_data, g_message->exc_data.size() * sizeof (mach_exception_data_type_t)); - return KERN_SUCCESS; + if (task_port == g_message->task_port) + { + g_message->task_port = task_port; + g_message->thread_port = thread_port; + g_message->exc_type = exc_type; + g_message->exc_data.resize(exc_data_count); + ::memcpy (&g_message->exc_data[0], exc_data, g_message->exc_data.size() * sizeof (mach_exception_data_type_t)); + return KERN_SUCCESS; + } + return KERN_FAILURE; } @@ -318,12 +322,13 @@ MachException::Message::Receive(mach_port_t port, mach_msg_option_t options, mac } bool -MachException::Message::CatchExceptionRaise() +MachException::Message::CatchExceptionRaise(task_t task) { bool success = false; // locker will keep a mutex locked until it goes out of scope // PThreadMutex::Locker locker(&g_message_mutex); // DNBLogThreaded("calling mach_exc_server"); + state.task_port = task; g_message = &state; // The exc_server function is the MIG generated server handling function // to handle messages from the kernel relating to the occurrence of an |