From a157df316546ac77207b2a3c5eb08fa140643866 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 31 Aug 2016 12:15:29 +0200 Subject: [PATCH] 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 --- 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 b193cfe2b..5d4a23d0f 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; }