Added an option to turn OFF the "detach on error" behavior that was added
to debugserver when launching processes.

<rdar://problem/16216199>

llvm-svn: 211658
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
index 2fadf33..21f9eda 100644
--- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
+++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
@@ -202,6 +202,10 @@
             packet_result = Handle_QSetDisableASLR (packet);
             break;
 
+        case StringExtractorGDBRemote::eServerPacketType_QSetDetachOnError:
+            packet_result = Handle_QSetDetachOnError (packet);
+            break;
+
         case StringExtractorGDBRemote::eServerPacketType_QSetSTDIN:
             packet_result = Handle_QSetSTDIN (packet);
             break;
@@ -1140,6 +1144,17 @@
 }
 
 GDBRemoteCommunication::PacketResult
+GDBRemoteCommunicationServer::Handle_QSetDetachOnError (StringExtractorGDBRemote &packet)
+{
+    packet.SetFilePos(::strlen ("QSetDetachOnError:"));
+    if (packet.GetU32(0))
+        m_process_launch_info.GetFlags().Set (eLaunchFlagDetachOnError);
+    else
+        m_process_launch_info.GetFlags().Clear (eLaunchFlagDetachOnError);
+    return SendOKResponse ();
+}
+
+GDBRemoteCommunication::PacketResult
 GDBRemoteCommunicationServer::Handle_QSetWorkingDir (StringExtractorGDBRemote &packet)
 {
     packet.SetFilePos(::strlen ("QSetWorkingDir:"));