4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-01-31 11:30:56 +08:00

* exceptions.cc (exception::handle): Add comment explaining si_addr behavior.

This commit is contained in:
Christopher Faylor 2013-06-07 16:05:12 +00:00
parent 9791177448
commit 0f38043d8b
2 changed files with 14 additions and 6 deletions

View File

@ -1,3 +1,8 @@
2013-06-07 Christopher Faylor <me.cygwin2013@cgf.cx>
* exceptions.cc (exception::handle): Add comment explaining si_addr
behavior.
2013-06-07 Christopher Faylor <me.cygwin2013@cgf.cx> 2013-06-07 Christopher Faylor <me.cygwin2013@cgf.cx>
* DevNotes: Add entry cgf-000023. * DevNotes: Add entry cgf-000023.

View File

@ -753,6 +753,10 @@ exception::handle (EXCEPTION_RECORD *e, exception_list *frame, CONTEXT *in, void
} }
cygwin_exception exc (framep, in, e); cygwin_exception exc (framep, in, e);
si.si_cyg = (void *) &exc; 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) si.si_addr = (si.si_signo == SIGSEGV || si.si_signo == SIGBUS)
? (void *) e->ExceptionInformation[1] : (void *) in->_GR(ip); ? (void *) e->ExceptionInformation[1] : (void *) in->_GR(ip);
me.incyg++; me.incyg++;
@ -767,12 +771,11 @@ exception::handle (EXCEPTION_RECORD *e, exception_list *frame, CONTEXT *in, void
#define SIG_NONMASKABLE (SIGTOMASK (SIGKILL) | SIGTOMASK (SIGSTOP)) #define SIG_NONMASKABLE (SIGTOMASK (SIGKILL) | SIGTOMASK (SIGSTOP))
/* Non-raceable sigsuspend /* Non-raceable sigsuspend
* Note: This implementation is based on the Single UNIX Specification Note: This implementation is based on the Single UNIX Specification
* man page. This indicates that sigsuspend always returns -1 and that man page. This indicates that sigsuspend always returns -1 and that
* attempts to block unblockable signals will be silently ignored. attempts to block unblockable signals will be silently ignored.
* This is counter to what appears to be documented in some UNIX This is counter to what appears to be documented in some UNIX
* man pages, e.g. Linux. man pages, e.g. Linux. */
*/
int __stdcall int __stdcall
handle_sigsuspend (sigset_t tempmask) handle_sigsuspend (sigset_t tempmask)
{ {