Commit Graph

69 Commits

Author SHA1 Message Date
gbeauche
b5ac365858 Add support for 64-bit MacOS X for PowerPC (untested beyond "it compiles"). 2007-12-31 06:59:39 +00:00
gbeauche
9fa1bbd972 According to kernel sources, that is XNU 344.49 (10.2.8), XNU 517.12.7 (10.3.9),
XNU 792.21.3 (10.4.10) and XNU 1228 (10.5.0), exception handler code[1] always
contains the fault address nowadays. So make it the default fast path but keep
provisions to check that at run-time first.

This yields a nearly 4x improvement in SIGSEGV recovery but MacOS X is still
suboptimal wrt. Linux, so VOSF is still not possible with frameskip == 0.

XXX: the ppc kernel had bugs that caused DAR (put into code[1]) to be incorrectly
decoded. This would need a broader test audience or more careful audit of the
sources changes.
2007-12-30 12:11:17 +00:00
gbeauche
902079ec8e Improve API for systems that require explicit calls to functions to retrieve
the memory addresses that triggered a SIGSEGV (e.g. MacOS X).
2007-12-30 08:45:18 +00:00
gbeauche
320b4ccd61 Add Darwin/x86_64 support. Fix EDX register index for i386 insn decoder. 2007-06-16 06:21:57 +00:00
gbeauche
974f086a8c Arrangements for Linux/mips. 2007-06-05 13:15:57 +00:00
gbeauche
87e1518e96 A few fixlets to the SIGSEGV library:
- Don't export transfer types definitions (formerly used by older API)
- Handle ADD instructions in ix86_skip_instruction() (generated by icc 9.1)
- Use "%p" format for EIP/RIP addresses
2006-07-19 21:31:10 +00:00
gbeauche
4c225b2705 MacOS X exception handling updates:
- Call user handler for KERN_INVALID_ADDRESS too (SIGBUS)
- Check for VALID_THREAD_STATE_FLAVOR in forward_exception()
- Return KERN_FAILURE if forward_exception() got an unknown behavior code
2006-05-09 06:24:05 +00:00
gbeauche
db76383246 decode movslq (generated by gcc4.1) 2006-03-30 22:45:49 +00:00
gbeauche
cafa8c8c89 add some barriers to make sure L_e_region* really come after the test insns 2006-02-27 13:38:52 +00:00
gbeauche
064973dbc7 ugly cast games 2006-01-24 21:33:26 +00:00
gbeauche
e0a966ee15 Code I wrote yesterday was totally broken. It's enough to make sure nPC is
correctly updated too... Instruction skipper now works on Solaris/SPARC.
2006-01-23 23:57:41 +00:00
gbeauche
99f5dcf66f - Fix SPARC Store Doubleword transfer_size in decoder.
- In the instruction skipper code, add a huge kludge (trampoline) to forcibly
  zero out %global registers when requested. Otherwise, Solaris/SPARC turned
  out to use %g1 during signal handling, and the zero we could have written
  to there vanished. This assumes [%sp-8] is valid to use (ABI states data
  below %sp is undefined though)
2006-01-22 23:14:48 +00:00
gbeauche
100a3e1abd Adapt for MacOS X for Intel, also fix thread_state type in forward_exception() 2006-01-22 00:05:05 +00:00
gbeauche
e308e5441b Mach exception recovery and instruction skipping for Darwin/x86. 2005-06-12 21:47:46 +00:00
gbeauche
35e8c8c9cd Enable instruction skipping for OpenBSD 3.4 on i386 2005-03-23 22:00:06 +00:00
gbeauche
f2908fe7bf instruction skipper for Solaris/i386 (Solaris 9) 2005-03-23 21:37:24 +00:00
gbeauche
10f38d4b50 NetBSD/ppc support 2005-02-20 11:39:12 +00:00
gbeauche
30632aed4f Happy New Year! 2005-01-30 21:42:16 +00:00
gbeauche
09d6712bdb Fixes for NetBSD 2.0 2005-01-04 23:38:01 +00:00
gbeauche
c10046c137 Check that we can really read at the faulty eip in Windows prior to decoding
the instruction. Also fix the unrecoverable fault dump to really be useful.
2004-12-11 13:07:38 +00:00
gbeauche
0e52edfbd0 ppc64 fixes 2004-12-02 23:29:52 +00:00
gbeauche
68083d1102 Integrate SIGSEGV recovery from libsigsegv for Windows and Cygwin.
Also implement instruction skipper for Windows/x86.
2004-11-13 23:44:11 +00:00
gbeauche
815390707a Decode MOVSX r32, r/m16 (generated by icc v8.0 on x86) 2004-02-16 16:02:48 +00:00
gbeauche
93c472ec0a cosmetic fixes when printing movsbq operation summary 2004-01-22 00:00:55 +00:00
gbeauche
7a0681c44b handle (skip) x86 movsbl instructions 2004-01-21 23:50:06 +00:00
gbeauche
1a6c128ab2 Summary: possible support of SheepShaver on Zaurus PDAs
Add Linux/ARM instruction skipping, includes support for ARMv4+ halfword
and signed data transfer instructions. Note that load/store multiple are
not handled and someone has to make sure post-incr/write-back logic is
correctly implemented.
2004-01-21 23:14:28 +00:00
nigel
2208c5460b Added missing switch value to eliminate a warning 2004-01-20 23:49:32 +00:00
gbeauche
d09df6d1fa ARM/linux sigsegv handler. Instruction skipper yet to be written for
happy Zaurus owners.
2004-01-19 16:59:13 +00:00
cebix
9e7932abf0 Happy New Year! :) 2004-01-12 15:29:31 +00:00
gbeauche
c48515b6d5 Instruction skipper for Solaris/SPARC. 2003-12-20 23:22:25 +00:00
gbeauche
47f64bdcb8 Add support for Linux/hppa, FreeBSD/alpha. Misc debugging output. 2003-12-20 21:50:08 +00:00
gbeauche
9b99a095f0 MIPS instruction skipper. TODO: check LWL/LWR semantics. 2003-12-20 10:06:18 +00:00
gbeauche
fdf5970c28 Fix subterfuge mode on IRIX/mips. Get PC in both modes for Irix too 2003-12-20 07:43:56 +00:00
gbeauche
d4ad77d734 really fix writes to byte registers 2003-11-11 00:10:39 +00:00
gbeauche
4bce0876c0 fix configure tests. i.e. move up arch_insn_skipper_tests() 2003-11-10 23:54:31 +00:00
gbeauche
1169001df7 Extend x86 instruction skipper to AMD64. Add plenty of arch dependent
opcodes to test it. Also fix DEBUG output & writes (zero'ing) to %xH regs
2003-11-10 23:47:39 +00:00
gbeauche
9057fda327 - FreeBSD/i386 sigcontext subterfuge support for instruction skipper
- NetBSD/alpha support from Boehm GC
- NetBSD/i386 won't work in sigcontext subterfuge mode unless instruction
  is decoded more accurately to compute the effective address. Also note
  that NetBSD 1.6 does not support siginfo_t yet.
2003-10-21 23:10:19 +00:00
gbeauche
f8a0f363ea Solaris/SPARC support for SIGSEGV_FAULT_INSTRUCTION 2003-10-21 21:59:41 +00:00
gbeauche
75df809ff7 fix merge with Mach exception filters, we have preconditions to check 2003-10-13 20:15:41 +00:00
gbeauche
6a60d56bf2 indentation fixes, optimize handle_badaccess() to receive only necessary
data and don't copy a struct sigcontext again on x86.
2003-10-13 19:56:17 +00:00
gbeauche
14b51b9519 return something more convenient to debug on errors 2003-10-13 19:43:09 +00:00
gbeauche
46dc8c5391 Make sure reported fault instruction address falls into the expected code
range. This is a configure-time safety net that depends on the GCC "Labels
as Values" extension.
2003-10-12 21:41:19 +00:00
gbeauche
cf3d36a3a7 Mach memory fault recovery from Michael Z. Sliczniak 2003-10-12 21:15:52 +00:00
gbeauche
23c4ebcdf3 really fix typo! 2003-09-29 08:04:22 +00:00
gbeauche
aa61c47591 fix typo 2003-09-29 08:02:04 +00:00
gbeauche
a48a804c15 New SIGSEGV API so that skip-instruction requests are more explicit. Yes,
that's api change, but that's cooler now for SheepShaver. ;-)
2003-09-29 07:02:58 +00:00
gbeauche
ac027954dc Bring x86 instruction skipper back to life 2003-08-17 10:52:52 +00:00
gbeauche
deb3da2e9f New API to ignore a SIGSEGV fault. This should help on SheepShaver/x86 for now
since I still don't know why MacOS would like to write to ROM on a particular
test.
2003-05-14 06:50:05 +00:00
gbeauche
177cdee820 configure script is reportedly no longer crashing on FreeBSD when
SIGSEGV_SKIP_INSTRUCTION is set.
2002-10-03 15:49:14 +00:00
gbeauche
281460fba0 - New arch support for IP retrieval on SIGSEGV. 2002-07-17 06:51:05 +00:00