summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/miscfuncs.cc
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2016-08-25 10:06:47 +0100
committerJon Turney <jon.turney@dronecode.org.uk>2016-08-25 10:06:47 +0100
commiteccefd9704a1e4764ca4fa4c6bf2610f21b8444f (patch)
tree2dcb043e53c3b8a27bbea4b05b7484479325e93a /winsup/cygwin/miscfuncs.cc
parent14228e2d0fe69ff12290f8859d14eecb4095396f (diff)
downloadcygnal-eccefd9704a1e4764ca4fa4c6bf2610f21b8444f.tar.gz
cygnal-eccefd9704a1e4764ca4fa4c6bf2610f21b8444f.tar.bz2
cygnal-eccefd9704a1e4764ca4fa4c6bf2610f21b8444f.zip
Fix SetThreadName with current gdb
Wrap SetThreadName()'s call to RaiseException() in __try/__except/__endtry, so that if the attached debugger doesn't know about MS_VC_EXCEPTION (e.g. current gdb and probably strace as well) and continues exception processing, we ignore it, rather than dying due an unhandled exception. Also remove an unnecessary cast in the RaiseException() invocation. Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Diffstat (limited to 'winsup/cygwin/miscfuncs.cc')
-rw-r--r--winsup/cygwin/miscfuncs.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/winsup/cygwin/miscfuncs.cc b/winsup/cygwin/miscfuncs.cc
index 5a63b267b..dc56cfded 100644
--- a/winsup/cygwin/miscfuncs.cc
+++ b/winsup/cygwin/miscfuncs.cc
@@ -1134,5 +1134,10 @@ SetThreadName(DWORD dwThreadID, const char* threadName)
#endif
};
- RaiseException (MS_VC_EXCEPTION, 0, sizeof (info)/sizeof (ULONG_PTR), (ULONG_PTR *) &info);
+ __try {
+ RaiseException (MS_VC_EXCEPTION, 0, sizeof (info)/sizeof (ULONG_PTR), info);
+ }
+ __except (NO_ERROR) {
+ }
+ __endtry
}