* exceptions.cc (_cygtls::signal_debugger): Move memcpy to copy context

from incoming siginfo_t to thread_context, too.
This commit is contained in:
Corinna Vinschen 2014-03-28 16:56:03 +00:00
parent 50b0a28824
commit c16097ed26
2 changed files with 9 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2014-03-28 Corinna Vinschen <corinna@vinschen.de>
* exceptions.cc (_cygtls::signal_debugger): Move memcpy to copy context
from incoming siginfo_t to thread_context, too.
2014-03-27 Corinna Vinschen <corinna@vinschen.de> 2014-03-27 Corinna Vinschen <corinna@vinschen.de>
* gendef (_sigbe/x86_64): Fix typo in .seh_proc pseudo-op. * gendef (_sigbe/x86_64): Fix typo in .seh_proc pseudo-op.

View File

@ -1487,9 +1487,7 @@ _cygtls::signal_debugger (siginfo_t& si)
{ {
SuspendThread (th); SuspendThread (th);
c.ContextFlags = CONTEXT_FULL; c.ContextFlags = CONTEXT_FULL;
if (GetThreadContext (th, &c)) if (!GetThreadContext (th, &c))
pc = &c;
else
goto out; goto out;
if (incyg) if (incyg)
#ifdef __x86_64__ #ifdef __x86_64__
@ -1497,9 +1495,10 @@ _cygtls::signal_debugger (siginfo_t& si)
#else #else
c.Eip = retaddr (); c.Eip = retaddr ();
#endif #endif
memcpy (&thread_context, pc, (&thread_context._internal - pc = &c;
(unsigned char *) &thread_context));
} }
memcpy (&thread_context, pc, (&thread_context._internal -
(unsigned char *) &thread_context));
#ifdef __x86_64__ #ifdef __x86_64__
char sigmsg[2 * sizeof (_CYGWIN_SIGNAL_STRING " ffffffff ffffffffffffffff")]; char sigmsg[2 * sizeof (_CYGWIN_SIGNAL_STRING " ffffffff ffffffffffffffff")];
#else #else