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

Robert Flack flackr at gmail.com
Tue Jan 27 13:42:08 PST 2015


Hi zturner,

When launched from lldb-platform, lldb-gdbserver's lifetime should be tied to the lldb-platform process. Otherwise the platform can die and leave a lingering lldb-gdbserver process. The existing launch argument LaunchInSeparateProcessGroup is used to denote this as this seems to be exactly what it is intended for.

REPOSITORY
  rL LLVM

http://reviews.llvm.org/D7211

Files:
  source/Plugins/Process/gdb-remote/GDBRemoteCommunication.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/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.18847.patch
Type: text/x-patch
Size: 1675 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150127/389199c0/attachment.bin>


More information about the lldb-commits mailing list