[Lldb-commits] [PATCH] D128504: debugserver: spawn process in its own process group

Alessandro Arzilli via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Jun 24 01:06:12 PDT 2022


aarzilli created this revision.
aarzilli added reviewers: jasonmolenda, clayborg.
aarzilli added a project: LLDB.
Herald added a subscriber: JDevlieghere.
Herald added a project: All.
aarzilli requested review of this revision.
Herald added a subscriber: lldb-commits.

Change POSIX spawn launch flavor to spawn process in its own process group, like the fork/exec flavor does.
This is useful because the target process can then be made controlling process for its tty and receive terminal signals (such as SIGINT generated in response to the user pressing ^C) without debugserver also receiving them.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D128504

Files:
  lldb/tools/debugserver/source/MacOSX/MachProcess.mm


Index: lldb/tools/debugserver/source/MacOSX/MachProcess.mm
===================================================================
--- lldb/tools/debugserver/source/MacOSX/MachProcess.mm
+++ lldb/tools/debugserver/source/MacOSX/MachProcess.mm
@@ -3268,7 +3268,7 @@
     return INVALID_NUB_PROCESS;
 
   flags = POSIX_SPAWN_START_SUSPENDED | POSIX_SPAWN_SETSIGDEF |
-          POSIX_SPAWN_SETSIGMASK;
+          POSIX_SPAWN_SETSIGMASK | POSIX_SPAWN_SETPGROUP;
   if (disable_aslr)
     flags |= _POSIX_SPAWN_DISABLE_ASLR;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128504.439658.patch
Type: text/x-patch
Size: 519 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220624/9e22915a/attachment.bin>


More information about the lldb-commits mailing list