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).
This commit is contained in:
Jeremy Drake via Cygwin-patches 2020-12-09 11:27:11 -08:00 committed by Corinna Vinschen
parent b6624e23e1
commit 21ec498d7f
1 changed files with 7 additions and 0 deletions

View File

@ -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; 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 /* We're adding the CREATE_BREAKAWAY_FROM_JOB flag here to workaround
issues with the "Program Compatibility Assistant (PCA) Service". issues with the "Program Compatibility Assistant (PCA) Service".
For some reason, when starting long running sessions from mintty(*), For some reason, when starting long running sessions from mintty(*),