This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
[PATCH 3/3] Set mcontext.cr2 to the faulting address
- From: Jon TURNEY <jon dot turney at dronecode dot org dot uk>
- To: cygwin-patches at cygwin dot com
- Cc: Jon TURNEY <jon dot turney at dronecode dot org dot uk>
- Date: Thu, 9 Apr 2015 14:13:25 +0100
- Subject: [PATCH 3/3] Set mcontext.cr2 to the faulting address
- Authentication-results: sourceware.org; auth=none
- References: <1428585205-14420-1-git-send-email-jon dot turney at dronecode dot org dot uk>
* 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 | 5 +++++
winsup/cygwin/exceptions.cc | 4 ++++
2 files changed, 9 insertions(+)
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index 0223052..919122e 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -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;
}
--
2.1.4