From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 76376384A01D; Thu, 10 Dec 2020 09:58:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 76376384A01D Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] cygwin: use CREATE_DEFAULT_ERROR_MODE in spawn X-Act-Checkin: newlib-cygwin X-Git-Author: Jeremy Drake via Cygwin-patches X-Git-Refname: refs/heads/master X-Git-Oldrev: b6624e23e17bdc505f639d9f181225dbf3a50fc6 X-Git-Newrev: 21ec498d7f91285018e74f9767fe46cebace682a Message-Id: <20201210095817.76376384A01D@sourceware.org> Date: Thu, 10 Dec 2020 09:58:17 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2020 09:58:17 -0000 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=21ec498d7f91285018e74f9767fe46cebace682a commit 21ec498d7f91285018e74f9767fe46cebace682a Author: Jeremy Drake via Cygwin-patches Date: Wed Dec 9 11:27:11 2020 -0800 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). Diff: --- winsup/cygwin/spawn.cc | 7 +++++++ 1 file changed, 7 insertions(+) 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(*),