diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 188542a65..ec59df527 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2014-03-28 Corinna Vinschen + + * exceptions.cc (_cygtls::signal_debugger): Move memcpy to copy context + from incoming siginfo_t to thread_context, too. + 2014-03-27 Corinna Vinschen * gendef (_sigbe/x86_64): Fix typo in .seh_proc pseudo-op. diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index fac65bf01..d335a0807 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -1487,9 +1487,7 @@ _cygtls::signal_debugger (siginfo_t& si) { SuspendThread (th); c.ContextFlags = CONTEXT_FULL; - if (GetThreadContext (th, &c)) - pc = &c; - else + if (!GetThreadContext (th, &c)) goto out; if (incyg) #ifdef __x86_64__ @@ -1497,9 +1495,10 @@ _cygtls::signal_debugger (siginfo_t& si) #else c.Eip = retaddr (); #endif - memcpy (&thread_context, pc, (&thread_context._internal - - (unsigned char *) &thread_context)); + pc = &c; } + memcpy (&thread_context, pc, (&thread_context._internal - + (unsigned char *) &thread_context)); #ifdef __x86_64__ char sigmsg[2 * sizeof (_CYGWIN_SIGNAL_STRING " ffffffff ffffffffffffffff")]; #else