public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
* [PATCH v2] cygwin: use CREATE_DEFAULT_ERROR_MODE in spawn
@ 2020-12-09 19:27 Jeremy Drake
  2020-12-10  9:47 ` Corinna Vinschen
  0 siblings, 1 reply; 2+ messages in thread
From: Jeremy Drake @ 2020-12-09 19:27 UTC (permalink / raw)
  To: cygwin-patches

This allows native processes to get Windows-default error handling
behavior (such as invoking the registered JIT debugger).

---
 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(*),
-- 
2.29.2.windows.3


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] cygwin: use CREATE_DEFAULT_ERROR_MODE in spawn
  2020-12-09 19:27 [PATCH v2] cygwin: use CREATE_DEFAULT_ERROR_MODE in spawn Jeremy Drake
@ 2020-12-10  9:47 ` Corinna Vinschen
  0 siblings, 0 replies; 2+ messages in thread
From: Corinna Vinschen @ 2020-12-10  9:47 UTC (permalink / raw)
  To: cygwin-patches

On Dec  9 11:27, Jeremy Drake via Cygwin-patches wrote:
> This allows native processes to get Windows-default error handling
> behavior (such as invoking the registered JIT debugger).
> 
> ---
>  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(*),
> -- 
> 2.29.2.windows.3

Pushed.


Thanks,
Corinna

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-10  9:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-09 19:27 [PATCH v2] cygwin: use CREATE_DEFAULT_ERROR_MODE in spawn Jeremy Drake
2020-12-10  9:47 ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).