From: Jason Molenda Date: Thu, 24 Nov 2022 18:56:01 +0000 (-0800) Subject: Change debugserver to spawn processes in their own pgrp X-Git-Tag: upstream/17.0.6~26602 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=33ac4fddc7906ba712c50cd3a9b02ae041d751ab;p=platform%2Fupstream%2Fllvm.git 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 . Differential Revision: https://reviews.llvm.org/D128504 --- diff --git a/lldb/tools/debugserver/source/MacOSX/MachProcess.mm b/lldb/tools/debugserver/source/MacOSX/MachProcess.mm index 70a8ecd..8f3d200 100644 --- a/lldb/tools/debugserver/source/MacOSX/MachProcess.mm +++ b/lldb/tools/debugserver/source/MacOSX/MachProcess.mm @@ -3307,7 +3307,7 @@ pid_t MachProcess::PosixSpawnChildForPTraceDebugging( 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;