[newlib-cygwin] strace: Don't print exception info for SetThreadName exception

Corinna Vinschen corinna@sourceware.org
Wed Aug 31 10:15:00 GMT 2016


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=a157df316546ac77207b2a3c5eb08fa140643866

commit a157df316546ac77207b2a3c5eb08fa140643866
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Wed Aug 31 12:15:29 2016 +0200

    strace: Don't print exception info for SetThreadName exception
    
    The new functionality to set the thread name for debugging purposes
    creates exception debugging events.  These are printed out when running
    strace.  Since these exceptions have nothing to do with real exceptions
    but are, like breakpoint execptions, expected and non-fatal, don't print
    exception info for them.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/utils/strace.cc | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/winsup/utils/strace.cc b/winsup/utils/strace.cc
index b193cfe..5d4a23d 100644
--- a/winsup/utils/strace.cc
+++ b/winsup/utils/strace.cc
@@ -751,15 +751,19 @@ proc_child (unsigned mask, FILE *ofile, pid_t pid)
 	  break;
 
 	case EXCEPTION_DEBUG_EVENT:
-	  if (ev.u.Exception.ExceptionRecord.ExceptionCode
-	      != (DWORD) STATUS_BREAKPOINT)
+	  switch (ev.u.Exception.ExceptionRecord.ExceptionCode)
 	    {
+	    case STATUS_BREAKPOINT:
+	    case 0x406d1388:		/* SetThreadName exception. */
+	      break;
+	    default:
 	      status = DBG_EXCEPTION_NOT_HANDLED;
 	      if (ev.u.Exception.dwFirstChance)
 		fprintf (ofile, "--- Process %lu, exception %08lx at %p\n",
 			 ev.dwProcessId,
 			 ev.u.Exception.ExceptionRecord.ExceptionCode,
 			 ev.u.Exception.ExceptionRecord.ExceptionAddress);
+	      break;
 	    }
 	  break;
 	}



More information about the Cygwin-cvs mailing list