Mike Hore
2003-11-10 03:24:47 UTC
Hi folks, I'm wondering if anybody knows if I can do anything
about this:
Back on old Mac OSs (like 7.x etc) with 68k Mops, I could
install a trap catching routine to catch the trap generated by the
CHK instruction if the check showed a bounds violation.
On the PowerPC, the equivalent instruction is tw/twi (trap word
/trap word immediate) which causes a trap if a specified condition
isn't met. The PowerMops array accessing sequence generates
this instruction if range_check? is true.
But on modern Mac OS's, especially OSX, how can
I install some code to catch this trap?
As it is at present, under OSX, if I deliberately do a bounds
violation, PowerMops unexpectedly quits.
If I do it under OS9, I get error 212 ("execute finds an odd
segment number") which is an internal checking error which
has no obvious connection with bounds violations -- my
current theory is that the system is just sending me to a
strange address that just happens to lead to a sequence of events
ending up with that error.
Now I can do an outrageous kludge under OS9 and just change
the error message to say "bounds violation", but that's hardly a
fix. Does anybody have any ideas on installing a handler for
the trap resulting from the tw/twi instruction?
Cheers, Mike.
-------------------------------------------------------------------
Mike Hore ***@OVE.invalid.icasolution.com.au
-------------------------------------------------------------------
about this:
Back on old Mac OSs (like 7.x etc) with 68k Mops, I could
install a trap catching routine to catch the trap generated by the
CHK instruction if the check showed a bounds violation.
On the PowerPC, the equivalent instruction is tw/twi (trap word
/trap word immediate) which causes a trap if a specified condition
isn't met. The PowerMops array accessing sequence generates
this instruction if range_check? is true.
But on modern Mac OS's, especially OSX, how can
I install some code to catch this trap?
As it is at present, under OSX, if I deliberately do a bounds
violation, PowerMops unexpectedly quits.
If I do it under OS9, I get error 212 ("execute finds an odd
segment number") which is an internal checking error which
has no obvious connection with bounds violations -- my
current theory is that the system is just sending me to a
strange address that just happens to lead to a sequence of events
ending up with that error.
Now I can do an outrageous kludge under OS9 and just change
the error message to say "bounds violation", but that's hardly a
fix. Does anybody have any ideas on installing a handler for
the trap resulting from the tw/twi instruction?
Cheers, Mike.
-------------------------------------------------------------------
Mike Hore ***@OVE.invalid.icasolution.com.au
-------------------------------------------------------------------