aboutsummaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2021-03-31 11:38:41 +0200
committerCorinna Vinschen <corinna@vinschen.de>2024-02-03 20:03:43 +0100
commit6d6e1e354d214ba70981afe8c92cb9c58d33ac54 (patch)
tree97326b08ffd76eb63c2683cf50c56e14e3f65dd7 /winsup
parentaa392df06bb3eb42e07dd68bda2443614ba6a051 (diff)
downloadnewlib-6d6e1e354d214ba70981afe8c92cb9c58d33ac54.zip
newlib-6d6e1e354d214ba70981afe8c92cb9c58d33ac54.tar.gz
newlib-6d6e1e354d214ba70981afe8c92cb9c58d33ac54.tar.bz2
Cygwin: Do not show Error dialogs by default
...in a non-Cygwin child process. Backported from MSYS2. Downstream commit message follows. In https://github.com/msys2/msys2-runtime/pull/18, we discussed a change that would allow default Windows error handling of spawned processes to kick in (such as registered JIT debuggers). We even agreed that it would make sense to hide this functionality behind a flag, `winjitdebug`. However, when this got upstreamed as 21ec498d7f (cygwin: use CREATE_DEFAULT_ERROR_MODE in spawn, 2020-12-09), that flag was deemed unnecessary. But it would appear that it _is_ necessary: As reported in https://github.com/msys2/MSYS2-packages/pull/2414#issuecomment-810841296 this new behavior is pretty disruptive e.g. in CI scenarios. So let's introduce that `winjitdebug` flag (settable via the environment variable `MSYS`) at long last. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/environ.cc1
-rw-r--r--winsup/cygwin/globals.cc1
-rw-r--r--winsup/cygwin/spawn.cc2
3 files changed, 3 insertions, 1 deletions
diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc
index dca5c5d..d35b956 100644
--- a/winsup/cygwin/environ.cc
+++ b/winsup/cygwin/environ.cc
@@ -122,6 +122,7 @@ static struct parse_thing
{"wincmdln", {&wincmdln}, setbool, NULL, {{false}, {true}}},
{"winsymlinks", {func: set_winsymlinks}, isfunc, NULL, {{0}, {0}}},
{"disable_pcon", {&disable_pcon}, setbool, NULL, {{false}, {true}}},
+ {"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 a94aa56..d14ea59 100644
--- a/winsup/cygwin/globals.cc
+++ b/winsup/cygwin/globals.cc
@@ -72,6 +72,7 @@ bool reset_com;
bool wincmdln;
winsym_t allow_winsymlinks = WSYM_default;
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 dc1c4ac..77dc6df 100644
--- a/winsup/cygwin/spawn.cc
+++ b/winsup/cygwin/spawn.cc
@@ -413,7 +413,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