Date: Sun, 7 Mar 1999 13:55:31 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Nate Eldredge cc: djgpp AT delorie DOT com Subject: Re: Getting cr2 in exception handler In-Reply-To: <36E1D56E.ABB127DE@cartsys.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Sat, 6 Mar 1999, Nate Eldredge wrote: > I have an application where I need to set up an exception handler for > page faults and have access to the value of cr2 (linear address to which > access faulted). Why couldn't you look at the instruction that faulted and use some heuristics to find out the address, without accessing cr2? For example, if the faulting instruction is "movl (%edx), %eax", then the offending address is in EDX. > So: Does anyone know of another way to find the value of cr2? I don't > care about it working in anything but CWSDPMI. I'd guess, with enough hacking of CWSDPMI, anything's possible ;-).