[Lldb-commits] [lldb] 33ac4fd - Change debugserver to spawn processes in their own pgrp

Jason Molenda via lldb-commits lldb-commits at lists.llvm.org
Thu Nov 24 10:59:33 PST 2022


Author: Jason Molenda
Date: 2022-11-24T10:59:12-08:00
New Revision: 33ac4fddc7906ba712c50cd3a9b02ae041d751ab

URL: https://github.com/llvm/llvm-project/commit/33ac4fddc7906ba712c50cd3a9b02ae041d751ab
DIFF: https://github.com/llvm/llvm-project/commit/33ac4fddc7906ba712c50cd3a9b02ae041d751ab.diff

LOG: Change debugserver to spawn processes in their own pgrp

Change debugserver's posix_spawn() to spawn an inferior process in
its own process group, so signals from the terminal like control-c
are passed to the inferior process instead of debugserer.  In lldb's
own native-host launching, there is a LaunchInfo option
LaunchInSeparateProcessGroup, and this mirrors the most common
setting of that on Darwin systems.

Patch by Alessandro Arzilli <alessandro.arzilli at gmail.com>.

Differential Revision: https://reviews.llvm.org/D128504

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/lldb/tools/debugserver/source/MacOSX/MachProcess.mm b/lldb/tools/debugserver/source/MacOSX/MachProcess.mm
index 70a8ecd708456..8f3d2004601b1 100644
--- a/lldb/tools/debugserver/source/MacOSX/MachProcess.mm
+++ b/lldb/tools/debugserver/source/MacOSX/MachProcess.mm
@@ -3307,7 +3307,7 @@ static bool mach_header_validity_test(uint32_t magic, uint32_t cputype) {
     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;
 


        


More information about the lldb-commits mailing list