diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc index 89e989a6e3..31ada029c4 100644 --- a/winsup/cygwin/environ.cc +++ b/winsup/cygwin/environ.cc @@ -128,6 +128,7 @@ static struct parse_thing {"winsymlinks", {func: set_winsymlinks}, isfunc, NULL, {{0}, {0}}}, {"disable_pcon", {&disable_pcon}, setbool, NULL, {{false}, {true}}}, {"enable_pcon", {&disable_pcon}, setnegbool, NULL, {{true}, {false}}}, + {"winjitdebug", {&winjitdebug}, setbool, NULL, {{false}, {true}}}, {NULL, {0}, setdword, 0, {{0}, {0}}} }; diff --git a/winsup/cygwin/globals.cc b/winsup/cygwin/globals.cc index 1541fa4782..f243aad97f 100644 --- a/winsup/cygwin/globals.cc +++ b/winsup/cygwin/globals.cc @@ -73,6 +73,7 @@ bool reset_com; bool wincmdln = true; winsym_t allow_winsymlinks = WSYM_deepcopy; bool disable_pcon; +bool winjitdebug = false; bool NO_COPY in_forkee; diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index 4d93c1348c..e0770aeddc 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -429,7 +429,7 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv, get the default error mode instead of inheriting the mode Cygwin uses. This allows things like Windows Error Reporting/JIT debugging to work with processes launched from a Cygwin shell. */ - if (!real_path.iscygexec ()) + if (winjitdebug && !real_path.iscygexec ()) c_flags |= CREATE_DEFAULT_ERROR_MODE; /* We're adding the CREATE_BREAKAWAY_FROM_JOB flag here to workaround