Subject: [Q] How to get faulted-upon address, hacks wanted
To: None <tech-kern@NetBSD.ORG>
From: VaX#n8 <vax@ccwf.cc.utexas.edu>
List: tech-kern
Date: 08/24/1995 14:05:29
I -really- need to get the faulted-upon address in a signal handler.
Linux has a field in it's sigcontext called cr2, which is evidently an
obscure name for some kind of effective-address field.

The only thing I can think of now is a machine-dependent hack that examines
the instruction that faulted and figures out what EA faulted, although
this probably won't work since some instr's could have many effective
addresses.  And it's ugly.

So, I'm fielding any suggestions; I'd rather not have to change OS's,
especially now that my project has extended to another semester.
However, a friend's Linux machine is fairly close-by, and I'd like to
graduate. :)

I'd entertain adding this functionality to the NetBSD kernel, although I
don't want to spend more than a week on it, and I'd like to make sure it's
the "right" way so that it gets integrated rather than blow the time on a
patch that will be ignored (and thus would make it difficult for my prof
and grad students to use the program).

Please send me some suggestions, even if it's "switch to another free unix
until we do X or figure out Y".
-- 
VaX#n8 (vak-sa-nate) - n, CS senior++ and Unix junkie - vax@ccwf.cc.utexas.edu
Deal with evil through strength, yet encourage good through trust.    - PGP me