From c16097ed26d35e987a1f7a0ff3851d35363bd337 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Fri, 28 Mar 2014 16:56:03 +0000 Subject: [PATCH] * exceptions.cc (_cygtls::signal_debugger): Move memcpy to copy context from incoming siginfo_t to thread_context, too. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/exceptions.cc | 9 ++++----- 2 files changed, 9 insertions(+), 5 deletions(-) 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