public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
* [PATCH] Cygwin: strace: ignore GCC exceptions
@ 2020-08-20 13:54 Ken Brown
  2020-08-20 14:06 ` Corinna Vinschen
  0 siblings, 1 reply; 3+ messages in thread
From: Ken Brown @ 2020-08-20 13:54 UTC (permalink / raw)
  To: cygwin-patches

Any C++ app that calls 'throw' on 64-bit Cygwin results in an
exception of type STATUS_GCC_THROW (0x20474343) generated by the C++
runtime.  Don't pollute the strace output by printing information
about this and other GCC exceptions.
---
 winsup/utils/strace.cc | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/winsup/utils/strace.cc b/winsup/utils/strace.cc
index 9b6569a70..2b317012d 100644
--- a/winsup/utils/strace.cc
+++ b/winsup/utils/strace.cc
@@ -790,6 +790,13 @@ proc_child (unsigned mask, FILE *ofile, pid_t pid)
 	    case STATUS_BREAKPOINT:
 	    case 0x406d1388:		/* SetThreadName exception. */
 	      break;
+#ifdef __x86_64__
+	    case 0x20474343:		/* STATUS_GCC_THROW. */
+	    case 0x21474343:		/* STATUS_GCC_UNWIND. */
+	    case 0x22474343:		/* STATUS_GCC_FORCED. */
+	      status = DBG_EXCEPTION_NOT_HANDLED;
+	      break;
+#endif
 	    default:
 	      status = DBG_EXCEPTION_NOT_HANDLED;
 	      if (ev.u.Exception.dwFirstChance)
-- 
2.28.0


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

* Re: [PATCH] Cygwin: strace: ignore GCC exceptions
  2020-08-20 13:54 [PATCH] Cygwin: strace: ignore GCC exceptions Ken Brown
@ 2020-08-20 14:06 ` Corinna Vinschen
  2020-08-20 14:52   ` Ken Brown
  0 siblings, 1 reply; 3+ messages in thread
From: Corinna Vinschen @ 2020-08-20 14:06 UTC (permalink / raw)
  To: cygwin-patches

Hi Ken,

On Aug 20 09:54, Ken Brown via Cygwin-patches wrote:
> Any C++ app that calls 'throw' on 64-bit Cygwin results in an
> exception of type STATUS_GCC_THROW (0x20474343) generated by the C++
> runtime.  Don't pollute the strace output by printing information
> about this and other GCC exceptions.
> ---
>  winsup/utils/strace.cc | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/winsup/utils/strace.cc b/winsup/utils/strace.cc
> index 9b6569a70..2b317012d 100644
> --- a/winsup/utils/strace.cc
> +++ b/winsup/utils/strace.cc
> @@ -790,6 +790,13 @@ proc_child (unsigned mask, FILE *ofile, pid_t pid)
>  	    case STATUS_BREAKPOINT:
>  	    case 0x406d1388:		/* SetThreadName exception. */
>  	      break;
> +#ifdef __x86_64__
> +	    case 0x20474343:		/* STATUS_GCC_THROW. */
> +	    case 0x21474343:		/* STATUS_GCC_UNWIND. */
> +	    case 0x22474343:		/* STATUS_GCC_FORCED. */
> +	      status = DBG_EXCEPTION_NOT_HANDLED;
> +	      break;
> +#endif
>  	    default:
>  	      status = DBG_EXCEPTION_NOT_HANDLED;
>  	      if (ev.u.Exception.dwFirstChance)
> -- 
> 2.28.0

Wouldn't it make sense to create a header defining the GCC status values
as in libgcc/unwind-seh.c and share this between exceptions.cc and
strace.cc?


Thanks,
Corinna

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

* Re: [PATCH] Cygwin: strace: ignore GCC exceptions
  2020-08-20 14:06 ` Corinna Vinschen
@ 2020-08-20 14:52   ` Ken Brown
  0 siblings, 0 replies; 3+ messages in thread
From: Ken Brown @ 2020-08-20 14:52 UTC (permalink / raw)
  To: cygwin-patches

On 8/20/2020 10:06 AM, Corinna Vinschen wrote:
> Wouldn't it make sense to create a header defining the GCC status values
> as in libgcc/unwind-seh.c and share this between exceptions.cc and
> strace.cc?

Yes, thanks for the suggestion.  New patch(es) on the way.  I called the header 
"gcc_seh.h".  Feel free to suggest a better name.

Ken

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

end of thread, other threads:[~2020-08-20 14:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-20 13:54 [PATCH] Cygwin: strace: ignore GCC exceptions Ken Brown
2020-08-20 14:06 ` Corinna Vinschen
2020-08-20 14:52   ` Ken Brown

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).