Skip to content

Commit

Permalink
cygwin: use CREATE_DEFAULT_ERROR_MODE in spawn
Browse files Browse the repository at this point in the history
This allows native processes to get Windows-default error handling
behavior (such as invoking the registered JIT debugger).
  • Loading branch information
Jeremy Drake via Cygwin-patches authored and github-cygwin committed Dec 10, 2020
1 parent b6624e2 commit 21ec498
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions winsup/cygwin/spawn.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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(*),
Expand Down

0 comments on commit 21ec498

Please sign in to comment.