delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/03/07/06:57:22

Date: Sun, 7 Mar 1999 13:55:31 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Nate Eldredge <nate AT cartsys DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: Getting cr2 in exception handler
In-Reply-To: <36E1D56E.ABB127DE@cartsys.com>
Message-ID: <Pine.SUN.3.91.990307135512.26544m-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

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 ;-).

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019