MSYS2-packages/msys2-runtime/0009-Do-not-convert-environment-for-strace.patch
Johannes Schindelin c0baa84dac msys2-runtime: upgrade to Cygwin v3.3.2
See https://github.com/msys2/msys2-runtime/pull/63

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2021-11-09 00:34:55 +01:00

34 lines
1.3 KiB
Diff

From b7ed4157cc491da1ff521e02236d058dcc8e9238 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B8=CC=86=20=D0=9F?=
=?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=BE=D0=B2?= <alexey.pawlow@gmail.com>
Date: Sun, 14 Apr 2019 21:50:55 +0300
Subject: [PATCH 09/N] Do not convert environment for strace
Strace is a Windows program so MSYS2 will convert all arguments and environment vars and that makes debugging msys2 software with strace very tricky.
---
winsup/cygwin/spawn.cc | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
index c128add..9a54114 100644
--- a/winsup/cygwin/spawn.cc
+++ b/winsup/cygwin/spawn.cc
@@ -572,11 +572,13 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv,
bool switch_user = ::cygheap->user.issetuid ()
&& (::cygheap->user.saved_uid
!= ::cygheap->user.real_uid);
+ bool keep_posix = (iscmd (argv[0], "strace.exe")
+ || iscmd (argv[0], "strace")) ? true : real_path.iscygexec ();
moreinfo->envp = build_env (envp, envblock, moreinfo->envc,
real_path.iscygexec (),
switch_user ? ::cygheap->user.primary_token ()
: NULL,
- real_path.iscygexec ());
+ keep_posix);
if (!moreinfo->envp || !envblock)
{
set_errno (E2BIG);
--
2.33.0