diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index b493bdc99..c36862ce8 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2013-07-19 Christopher Faylor + + * exceptions.cc (signal_exit): Only dump core when it's a "kernel" + signal. Only use RtlCaptureContext on x86_64. It doesn't seem to do + what's expected on x86. + 2013-07-19 Christopher Faylor * spawn.cc (child_info_spawn::worker): Reinstate using temp buffer for diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index 46af2ba78..3f1cdbfdb 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -1215,7 +1215,8 @@ signal_exit (int sig, siginfo_t *si) case SIGTRAP: case SIGXCPU: case SIGXFSZ: - sig |= 0x80; /* Flag that we've "dumped core" */ + if (si->si_code == SI_KERNEL) + sig |= 0x80; /* Flag that we've "dumped core" */ if (try_to_debug ()) break; if (si->si_code != SI_USER && si->si_cyg) @@ -1224,10 +1225,11 @@ signal_exit (int sig, siginfo_t *si) { CONTEXT c; c.ContextFlags = CONTEXT_FULL; - RtlCaptureContext (&c); #ifdef __x86_64__ + RtlCaptureContext (&c); cygwin_exception exc ((PUINT_PTR) _my_tls.thread_context.rbp, &c); #else + GetThreadContext (GetCurrentThread (), &c); cygwin_exception exc ((PUINT_PTR) _my_tls.thread_context.ebp, &c); #endif exc.dumpstack ();