summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Drake via Cygwin-patches <cygwin-patches@cygwin.com>2020-12-09 11:27:11 -0800
committerCorinna Vinschen <corinna@vinschen.de>2020-12-10 10:57:40 +0100
commit21ec498d7f91285018e74f9767fe46cebace682a (patch)
tree1d0b690199b3d9ef51f5c7a052650169adf33293
parentb6624e23e17bdc505f639d9f181225dbf3a50fc6 (diff)
downloadcygnal-21ec498d7f91285018e74f9767fe46cebace682a.tar.gz
cygnal-21ec498d7f91285018e74f9767fe46cebace682a.tar.bz2
cygnal-21ec498d7f91285018e74f9767fe46cebace682a.zip
cygwin: use CREATE_DEFAULT_ERROR_MODE in spawn
This allows native processes to get Windows-default error handling behavior (such as invoking the registered JIT debugger).
-rw-r--r--winsup/cygwin/spawn.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
index 92d190d1a..83b216f52 100644
--- a/winsup/cygwin/spawn.cc
+++ b/winsup/cygwin/spawn.cc
@@ -431,6 +431,13 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv,
c_flags |= CREATE_SEPARATE_WOW_VDM | CREATE_UNICODE_ENVIRONMENT;
+ /* Add CREATE_DEFAULT_ERROR_MODE flag for non-Cygwin processes so they
+ 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 ())
+ c_flags |= CREATE_DEFAULT_ERROR_MODE;
+
/* We're adding the CREATE_BREAKAWAY_FROM_JOB flag here to workaround
issues with the "Program Compatibility Assistant (PCA) Service".
For some reason, when starting long running sessions from mintty(*),