X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fx86-assem.S;h=0deae4f381350445a3c2d966d6c2bdd0b14ce69e;hb=5de74c72e5a9522c7fdd3dbb31a39641e9de8877;hp=33820b4bd71c423a2d6baeeec8752daf0e879b8d;hpb=53dd919e3b97fe7a63b6826d812eef6bac0ca9ad;p=sbcl.git diff --git a/src/runtime/x86-assem.S b/src/runtime/x86-assem.S index 33820b4..0deae4f 100644 --- a/src/runtime/x86-assem.S +++ b/src/runtime/x86-assem.S @@ -82,10 +82,20 @@ #define SIZE(name) #endif +/* + * x86/darwin (as of MacOS X 10.4.5) doesn't reliably file signal + * handlers (SIGTRAP or Mach exception handlers) for 0xCC, wo we have + * to use ud2 instead. ud2 is an undefined opcode, #x0b0f, or + * 0F 0B in low-endian notation, that causes SIGILL to fire. We check + * for this instruction in the SIGILL handler and if we see it, we + * advance the EIP by two bytes to skip over ud2 instruction and + * call sigtrap_handler. */ #if defined(LISP_FEATURE_DARWIN) #define END() +#define TRAP ud2 #else #define END() .end +#define TRAP int3 #endif .text @@ -336,7 +346,7 @@ GNAME(fpu_restore): TYPE(GNAME(undefined_tramp)) .byte 0, 0, 0, SIMPLE_FUN_HEADER_WIDETAG GNAME(undefined_tramp): - int3 + TRAP .byte trap_Error .byte 2 .byte UNDEFINED_FUN_ERROR @@ -385,7 +395,7 @@ multiple_value_return: .globl GNAME(fun_end_breakpoint_trap) GNAME(fun_end_breakpoint_trap): - int3 + TRAP .byte trap_FunEndBreakpoint hlt # We should never return here. @@ -397,7 +407,7 @@ GNAME(fun_end_breakpoint_end): TYPE(GNAME(do_pending_interrupt)) .align align_4byte,0x90 GNAME(do_pending_interrupt): - int3 + TRAP .byte trap_PendingInterrupt ret SIZE(GNAME(do_pending_interrupt)) @@ -861,7 +871,7 @@ GNAME(sigtrap_trampoline): call GNAME(sigtrap_wrapper) pop %eax pop %eax - int3 + TRAP .byte trap_ContextRestore hlt # We should never return here. @@ -877,7 +887,7 @@ GNAME(exception_trampoline): call GNAME(handle_win32_exception_wrapper) pop %eax pop %eax - int3 + TRAP .byte trap_ContextRestore hlt # We should never return here. #endif