Subject: Re: delivering faulted-upon address in trap frame to userland
To: Travis H. <solinym@gmail.com>
From: Matt Thomas <matt@3am-software.com>
List: port-i386
Date: 08/25/2006 19:39:57
Travis H. wrote:
> Heya,
> 
> A long time ago someone hacked up the signal delivery mechanisms so
> that one of the registers in x86 (I think CR2) was passed as part of a
> stack frame to signal handlers, and eventually delivered to the signal
> handler so that you could mprotect pages, and trap signals, so that
> later when the page was accessed the signal handler could figure out
> what page generated the trap.  Is this in NetBSD still?
> 
> IIRC, OpenBSD did a better job of it, seperating the signal handler's
> frame into a machine-independent and machine-dependent part.
> 
> This allows you to profile what pages an application accesses.

Look for SA_SIGINFO.
-- 
Matt Thomas                     email: matt@3am-software.com
3am Software Foundry              www: http://3am-software.com/bio/matt/
Cupertino, CA              disclaimer: I avow all knowledge of this message.