[Lldb-commits] [PATCH] Launch lldb-gdbserver in same process group when launched remotely using lldb-platform.

Robert Flack flackr at gmail.com
Wed Jan 28 08:53:45 PST 2015


Explicitly set LaunchInSeparateProcessGroup to false from GDBRemoteCommunicationServer::Handle_qLaunchGDBServer to make this explicit and not rely on default value.


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D7211

Files:
  source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
  source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
  source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Index: source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
===================================================================
--- source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
+++ source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
@@ -757,10 +757,12 @@
         }
 
         // use native registers, not the GDB registers
-        debugserver_args.AppendArgument("--native-regs");   
-        // make debugserver run in its own session so signals generated by 
-        // special terminal key sequences (^C) don't affect debugserver
-        debugserver_args.AppendArgument("--setsid");
+        debugserver_args.AppendArgument("--native-regs");
+
+        if (launch_info.GetLaunchInSeparateProcessGroup())
+        {
+            debugserver_args.AppendArgument("--setsid");
+        }
 
         char named_pipe_path[PATH_MAX];
         named_pipe_path[0] = '\0';
Index: source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
===================================================================
--- source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
+++ source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
@@ -1921,6 +1921,9 @@
         if (log)
             log->Printf("Launching debugserver with: %s:%u...\n", hostname.c_str(), port);
 
+        // Do not run in a new session so that it can not linger after the
+        // platform closes.
+        debugserver_launch_info.SetLaunchInSeparateProcessGroup(false);
         debugserver_launch_info.SetMonitorProcessCallback(ReapDebugserverProcess, this, false);
 
         std::string platform_scheme;
Index: source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
===================================================================
--- source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -2764,6 +2764,10 @@
         static FileSpec g_debugserver_file_spec;
 
         ProcessLaunchInfo debugserver_launch_info;
+        // Make debugserver run in its own session so signals generated by
+        // special terminal key sequences (^C) don't affect debugserver.
+        debugserver_launch_info.SetLaunchInSeparateProcessGroup(true);
+
         debugserver_launch_info.SetMonitorProcessCallback (MonitorDebugserverProcess, this, false);
         debugserver_launch_info.SetUserID(process_info.GetUserID());

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7211.18897.patch
Type: text/x-patch
Size: 2408 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150128/cd86a085/attachment.bin>


More information about the lldb-commits mailing list