aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/miscfuncs.cc
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2016-09-11 13:37:54 +0100
committerJon Turney <jon.turney@dronecode.org.uk>2016-10-20 13:12:20 +0100
commit93374181cba2a6e3e49adacaaa4a37c0e31e97a2 (patch)
tree1afec63dab32f01bc613074301c1f67834879a56 /winsup/cygwin/miscfuncs.cc
parentafcde266182f4283a3a777570face6457b8d22b0 (diff)
downloadnewlib-93374181cba2a6e3e49adacaaa4a37c0e31e97a2.zip
newlib-93374181cba2a6e3e49adacaaa4a37c0e31e97a2.tar.gz
newlib-93374181cba2a6e3e49adacaaa4a37c0e31e97a2.tar.bz2
Fix SetThreadName with gdb 7.10 on x86
Additionally to eccefd97, we need to ensure the exception handler is installed for the _ljfault used to implement _try/_except to get called. Also use the correct macro for x86 conditional compilation. Addresses https://cygwin.com/ml/cygwin/2016-09/msg00143.html Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Diffstat (limited to 'winsup/cygwin/miscfuncs.cc')
-rw-r--r--winsup/cygwin/miscfuncs.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/winsup/cygwin/miscfuncs.cc b/winsup/cygwin/miscfuncs.cc
index fbd024f..f90d6ef 100644
--- a/winsup/cygwin/miscfuncs.cc
+++ b/winsup/cygwin/miscfuncs.cc
@@ -1129,11 +1129,18 @@ SetThreadName(DWORD dwThreadID, const char* threadName)
0x1000, /* type, must be 0x1000 */
(ULONG_PTR) threadName, /* pointer to threadname */
dwThreadID, /* thread ID (+ flags on x86_64) */
-#ifdef __X86__
+#ifdef _X86_
0, /* flags, must be zero */
#endif
};
+#ifdef _X86_
+ /* On x86, for __try/__except to work, we must ensure our exception handler is
+ installed, which may not be the case if this is being called during early
+ initialization. */
+ exception protect;
+#endif
+
__try
{
RaiseException (MS_VC_EXCEPTION, 0, sizeof (info) / sizeof (ULONG_PTR),