aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/exceptions.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2014-03-28 16:56:03 +0000
committerCorinna Vinschen <corinna@vinschen.de>2014-03-28 16:56:03 +0000
commitc16097ed26d35e987a1f7a0ff3851d35363bd337 (patch)
tree5bd492f95f27fbd2a5256c43d6fa90648a382ac8 /winsup/cygwin/exceptions.cc
parent50b0a28824744cad81569fa5e4e5e63a07cca760 (diff)
downloadnewlib-c16097ed26d35e987a1f7a0ff3851d35363bd337.zip
newlib-c16097ed26d35e987a1f7a0ff3851d35363bd337.tar.gz
newlib-c16097ed26d35e987a1f7a0ff3851d35363bd337.tar.bz2
* exceptions.cc (_cygtls::signal_debugger): Move memcpy to copy context
from incoming siginfo_t to thread_context, too.
Diffstat (limited to 'winsup/cygwin/exceptions.cc')
-rw-r--r--winsup/cygwin/exceptions.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index fac65bf..d335a08 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