This is the mail archive of the cygwin-cvs@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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;
 	}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]