Set mcontext.cr2 to the faulting address

* exceptions.cc (call_signal_handler): Set mcontext.cr2 to the
	faulting address.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
This commit is contained in:
Jon TURNEY 2015-04-04 16:12:27 +01:00 committed by Corinna Vinschen
parent 9043956ce8
commit bccc0e83e8
2 changed files with 9 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2015-04-04 Jon TURNEY <jon.turney@dronecode.org.uk>
* exceptions.cc (call_signal_handler): Set mcontext.cr2 to the
faulting address.
2015-04-02 Jon TURNEY <jon.turney@dronecode.org.uk>
* exceptions.cc (call_signal_handler): Only bother to construct

View File

@ -1521,6 +1521,10 @@ _cygtls::call_signal_handler ()
context.uc_sigmask = context.uc_mcontext.oldmask = this_oldmask;
context.uc_mcontext.cr2 = (thissi.si_signo == SIGSEGV
|| thissi.si_signo == SIGBUS)
? (uintptr_t) thissi.si_addr : 0;
thiscontext = &context;
}