summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/exceptions.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2013-06-07 16:05:12 +0000
committerChristopher Faylor <me@cgf.cx>2013-06-07 16:05:12 +0000
commit0f38043d8bda7c157f916a3e77cb4f84d17355bd (patch)
treeee5566a85fa65956aafe1d2a810d6ee264e07295 /winsup/cygwin/exceptions.cc
parent97911774484304d27f9db9581b10e4dac0189134 (diff)
downloadcygnal-0f38043d8bda7c157f916a3e77cb4f84d17355bd.tar.gz
cygnal-0f38043d8bda7c157f916a3e77cb4f84d17355bd.tar.bz2
cygnal-0f38043d8bda7c157f916a3e77cb4f84d17355bd.zip
* exceptions.cc (exception::handle): Add comment explaining si_addr behavior.
Diffstat (limited to 'winsup/cygwin/exceptions.cc')
-rw-r--r--winsup/cygwin/exceptions.cc15
1 files changed, 9 insertions, 6 deletions
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index aa0036a18..c1b313910 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -753,6 +753,10 @@ exception::handle (EXCEPTION_RECORD *e, exception_list *frame, CONTEXT *in, void
}
cygwin_exception exc (framep, in, e);
si.si_cyg = (void *) &exc;
+ /* POSIX requires that for SIGSEGV and SIGBUS, si_addr should be set to the
+ address of faulting memory reference. For SIGILL and SIGFPE these should
+ be the address of the faulting instruction. Other signals are apparently
+ undefined so we just set those to the faulting instruction too. */
si.si_addr = (si.si_signo == SIGSEGV || si.si_signo == SIGBUS)
? (void *) e->ExceptionInformation[1] : (void *) in->_GR(ip);
me.incyg++;
@@ -767,12 +771,11 @@ exception::handle (EXCEPTION_RECORD *e, exception_list *frame, CONTEXT *in, void
#define SIG_NONMASKABLE (SIGTOMASK (SIGKILL) | SIGTOMASK (SIGSTOP))
/* Non-raceable sigsuspend
- * Note: This implementation is based on the Single UNIX Specification
- * man page. This indicates that sigsuspend always returns -1 and that
- * attempts to block unblockable signals will be silently ignored.
- * This is counter to what appears to be documented in some UNIX
- * man pages, e.g. Linux.
- */
+ Note: This implementation is based on the Single UNIX Specification
+ man page. This indicates that sigsuspend always returns -1 and that
+ attempts to block unblockable signals will be silently ignored.
+ This is counter to what appears to be documented in some UNIX
+ man pages, e.g. Linux. */
int __stdcall
handle_sigsuspend (sigset_t tempmask)
{