]> sourceware.org Git - newlib-cygwin.git/commitdiff
Set mcontext.cr2 to the faulting address
authorJon TURNEY <jon.turney@dronecode.org.uk>
Sat, 4 Apr 2015 15:12:27 +0000 (16:12 +0100)
committerJon TURNEY <jon.turney@dronecode.org.uk>
Fri, 10 Apr 2015 14:34:44 +0000 (15:34 +0100)
* exceptions.cc (call_signal_handler): Set mcontext.cr2 to the
faulting address.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
winsup/cygwin/ChangeLog
winsup/cygwin/exceptions.cc

index ec70f1a1f2b380a01010a6d4a940c4362784a0ff..6e71e610ca046f305bb764df6d7d3353d1138d4e 100644 (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
index 0c9ee14593629afa8ba7ad52b7d78812ec2f8ff8..4a6c21e7c415ad7e4d48b8392851d82e05ab03a1 100644 (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;
        }
 
This page took 0.031655 seconds and 5 git commands to generate.