diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc index bbd843fc54..1e82b9fe7a 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 712792e014..b3b77de405 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; /* Taken from BSD libc: This variable is zero until a process has created a pthread. It is used diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index 8b11b9d589..ce1999de9e 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -440,7 +440,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