Skip to content

Commit

Permalink
Do not convert environment for strace
Browse files Browse the repository at this point in the history
Strace is a Windows program so MSYS2 will convert all arguments and environment vars and that makes debugging msys2 software with strace very tricky.
  • Loading branch information
Alexpux authored and lazka committed Aug 25, 2024
1 parent 55cc413 commit e7d9d44
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion winsup/cygwin/spawn.cc
Original file line number Diff line number Diff line change
Expand Up @@ -545,11 +545,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);
Expand Down

0 comments on commit e7d9d44

Please sign in to comment.