Commit Graph

88 Commits

Author SHA1 Message Date
asvitkine
abb9d2eb24 make sigsegv work better with cygwin 2009-04-13 19:57:08 +00:00
asvitkine
8375c57047 move sigsegv_info_t declaration to header 2009-02-11 20:44:10 +00:00
asvitkine
ca2b9b5832 [Patch from Mike Sliczniak]
This first patch gets B2 and SS to build under Leopard and Tiger.

I tested this on a 32-bit intel 10.5.6 mac like so:

B2
./autogen.sh --disable-standalone-gui --enable-vosf --enable-sdl-video --enable-sdl-audio --enable-addressing=real --without-esd --without-gtk --without-mon --without-x

SS
./autogen.sh --disable-standalone-gui --enable-vosf -enable-sdl-video --disable-sdl-audio --enable-addressing=real --without-esd --without-gtk --without-mon --without-x --enable-jit

There is also a little tweak so that you can use sdl audio in SheepShaver when building for Mac OS X.
2009-02-11 19:23:53 +00:00
gbeauche
3f15f4ed26 64-bit Mach exceptions support. Note that mach_exc_server() et al. must be
explicitly generated from mig. The advantage of that is to provide a "fast"
path for x86_64 on Leopard too (fault address in code[1]).

By "fast", this means +33% faster wrt. explicitly thread_get_state() but
still pretty slow (40 usec/fault). This is on par with the i386 code path though.
2008-01-20 22:24:53 +00:00
gbeauche
68668bb4e2 Add support for Windows/ia64. 2008-01-20 17:09:34 +00:00
gbeauche
2bdb300da1 HPPA support. 2008-01-20 00:39:51 +00:00
gbeauche
88ea04a365 Add support for HP-UX/ia64. It would be best to use libunwind so that to
handle stacked registers access with ease...
2008-01-19 22:27:29 +00:00
gbeauche
3615be1d4d Use fixed-size integer types, especially for 64-bit quantities. HP-UX for IPF
is essentially an ILP32 platform but machine registers are 64-bit wide. Make
IA64_SET_GR() set the NaT bit at the same time as the register value.
2008-01-19 22:25:27 +00:00
gbeauche
ef39e46cb2 Fix build on MacOS X Leopard.
Leopard kernel faster? This is pure marketing hype. For 32-bit applications,
Mach exception recovery is 60% slower. For 64-bit applications, this is up
to 40% faster though. In any case, MacOS X remains pretty slow wrt. Linux...
2008-01-14 19:29:29 +00:00
gbeauche
df3475ed16 64-bit Windows support 2008-01-12 23:01:40 +00:00
gbeauche
b1fa25128a Make it possible to override the Mach fault recovery scheme through an
environment variable: SIGSEGV_MACH_FAULT. It can be set to "direct" to
assume the fault address comes from code[1] argument, or "slow" to use
the slow path through thread_get_status(EXCEPTION_STATE)->faultvaddr.
2008-01-07 22:44:39 +00:00
gbeauche
58ff9aba45 The Linux kernel actually allows to restart execution from the specified slot
in the bundle. This is faster and more accurate as this avoids emulation.

Also clean-up code so that to prepare the use of lib uaccess on hpux/ia64.
XXX: this will need explicit use of uint64_t to define registers because
HP/UX is ILP32 capable and all registers are 64-bit capable so "unsigned long"
won't fit.
2008-01-06 17:22:19 +00:00
gbeauche
8aadf8e455 Further comment the ia64 decoder and (minimal) emulator. 2008-01-06 16:36:00 +00:00
gbeauche
57ae6ed470 Add initial support for instruction skipping on Linux/ia64. It was more
complex than expected but it was fun to play with. Who designed this ISA?
I'd love to see how the decoder is implemented in HW, by all means it is
not "simplified" unless I missed some pattern...
2008-01-06 16:25:03 +00:00
gbeauche
a56e4b9be0 Hack around over-optimized labels-as-values extension from GCC. 2008-01-06 16:19:27 +00:00
gbeauche
e08bb16edf ISO C++ conformance fixes: remove superfluous coma at the end of enum definitions. 2008-01-06 16:10:30 +00:00
gbeauche
a93bec88fd Don't clobber "sip" arg from our sigsegv_info wrapper (renamed to SIP). 2008-01-05 08:35:08 +00:00
gbeauche
c8cb4879a4 Happy New Year! 2008-01-01 09:40:36 +00:00
gbeauche
26f9b1d38b Fix instruction skipping on MacOS X in the fast path case. 2007-12-31 18:07:01 +00:00
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