X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fwin32-os.c;h=fb3ad0bdb4b01c7867b11e1c30ee21c044ccf68b;hb=743831e679b673a5680a0afd8402911516bf50e2;hp=eab029e1ce79086403a00af1fea998681aa91932;hpb=b841aa690bada10da8c8db6eec361e3eeef0492c;p=sbcl.git diff --git a/src/runtime/win32-os.c b/src/runtime/win32-os.c index eab029e..fb3ad0b 100644 --- a/src/runtime/win32-os.c +++ b/src/runtime/win32-os.c @@ -298,6 +298,17 @@ is_valid_lisp_addr(os_vm_address_t addr) /* A tiny bit of interrupt.c state we want our paws on. */ extern boolean internal_errors_enabled; +#ifdef LISP_FEATURE_UD2_BREAKPOINTS +#define IS_TRAP_EXCEPTION(exception_record, context) \ + (((exception_record)->ExceptionCode == EXCEPTION_ILLEGAL_INSTRUCTION) && \ + (((unsigned short *)((context)->Eip))[0] == 0x0b0f)) +#define TRAP_CODE_WIDTH 2 +#else +#define IS_TRAP_EXCEPTION(exception_record, context) \ + ((exception_record)->ExceptionCode == EXCEPTION_BREAKPOINT) +#define TRAP_CODE_WIDTH 1 +#endif + /* * A good explanation of the exception handling semantics is * http://win32assembly.online.fr/Exceptionhandling.html . @@ -330,7 +341,7 @@ handle_exception(EXCEPTION_RECORD *exception_record, return ExceptionContinueExecution; } - if (exception_record->ExceptionCode == EXCEPTION_BREAKPOINT) { + if (IS_TRAP_EXCEPTION(exception_record, context)) { unsigned char trap; /* This is just for info in case the monitor wants to print an * approximation. */ @@ -338,7 +349,7 @@ handle_exception(EXCEPTION_RECORD *exception_record, (lispobj *)*os_context_sp_addr(context); /* Unlike some other operating systems, Win32 leaves EIP * pointing to the breakpoint instruction. */ - context->Eip++; + context->Eip += TRAP_CODE_WIDTH; /* Now EIP points just after the INT3 byte and aims at the * 'kind' value (eg trap_Cerror). */ trap = *(unsigned char *)(*os_context_pc_addr(context)); @@ -418,7 +429,7 @@ handle_exception(EXCEPTION_RECORD *exception_record, _clearfp(); /* Call into lisp to handle things. */ - funcall2(SymbolFunction(HANDLE_WIN32_EXCEPTION), context_sap, + funcall2(StaticSymbolFunction(HANDLE_WIN32_EXCEPTION), context_sap, exception_record_sap); /* If Lisp doesn't nlx, we need to put things back. */ @@ -540,14 +551,9 @@ void scratch(void) _get_osfhandle(0); _pipe(0,0,0); access(0,0); - acos(0); - asin(0); close(0); - cosh(0); dup(0); - hypot(0, 0); isatty(0); - sinh(0); strerror(42); write(0, 0, 0); RtlUnwind(0, 0, 0, 0); @@ -576,7 +582,7 @@ void scratch(void) } char * -os_get_runtime_executable_path() +os_get_runtime_executable_path(int external) { char path[MAX_PATH + 1]; DWORD bufsize = sizeof(path);