[Openmcl-cvs-notifications] r10891 - /trunk/source/lisp-kernel/x86-exceptions.c

gb at clozure.com gb at clozure.com
Fri Sep 26 10:01:53 EDT 2008


Author: gb
Date: Fri Sep 26 10:01:53 2008
New Revision: 10891

Log:
Ensure that EXCEPTION_WRITE_FAULT is defined on 32-bit Windows.

Use the new format-string convention.

Modified:
    trunk/source/lisp-kernel/x86-exceptions.c

Modified: trunk/source/lisp-kernel/x86-exceptions.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/lisp-kernel/x86-exceptions.c (original)
+++ trunk/source/lisp-kernel/x86-exceptions.c Fri Sep 26 10:01:53 2008
@@ -42,6 +42,9 @@
 #ifdef WIN_64
 #include <winternl.h>
 #include <ntstatus.h>
+#endif
+#ifndef EXCEPTION_WRITE_FAULT
+#define EXCEPTION_WRITE_FAULT 1
 #endif
 #endif
 =

@@ -1143,7 +1146,7 @@
 =

   LOCK(lisp_global(EXCEPTION_LOCK), tcr);
 #if 0
-  fprintf(stderr, "0x%x has exception lock\n", tcr);
+  fprintf(stderr, "0x" LISP " has exception lock\n", tcr);
 #endif
   xf->curr =3D context;
 #ifdef X8632
@@ -1166,7 +1169,7 @@
   tcr->valence =3D TCR_STATE_EXCEPTION_RETURN;
   UNLOCK(lisp_global(EXCEPTION_LOCK),tcr);
 #if 0
-  fprintf(stderr, "0x%x released exception lock\n", tcr);
+  fprintf(stderr, "0x" LISP " released exception lock\n", tcr);
 #endif
 }
 =

@@ -1231,7 +1234,7 @@
     char msg[512];
     Boolean foreign =3D (old_valence !=3D TCR_STATE_LISP);
 =

-    snprintf(msg, sizeof(msg), "Unhandled exception %d at 0x%lx, context->=
regs at #x%lx", signum, xpPC(context), (natural)xpGPRvector(context));
+    snprintf(msg, sizeof(msg), "Unhandled exception %d at 0x" LISP ", cont=
ext->regs at #x" LISP "", signum, xpPC(context), (natural)xpGPRvector(conte=
xt));
     =

     if (lisp_Debugger(context, info, signum,  foreign, msg)) {
       SET_TCR_FLAG(tcr,TCR_FLAG_BIT_PROPAGATE_EXCEPTION);
@@ -1798,7 +1801,7 @@
   return windows_switch_to_foreign_stack(foreign_rsp,handler,new_ep);
 }
 =

-LONG
+LONG CALLBACK
 windows_arbstack_exception_handler(EXCEPTION_POINTERS *exception_pointers)
 {
   DWORD code =3D exception_pointers->ExceptionRecord->ExceptionCode;
@@ -2251,7 +2254,7 @@
     if ((state =3D=3D ID_unrecognized_alloc_instruction) ||
         ((state =3D=3D ID_set_allocptr_header_instruction) &&
          (allocptr_tag !=3D fulltag_misc))) {
-      Bug(xp, "Can't determine state of thread 0x%lx, interrupted during m=
emory allocation", tcr);
+      Bug(xp, "Can't determine state of thread 0x" LISP ", interrupted dur=
ing memory allocation", tcr);
     }
     switch(state) {
     case ID_set_allocptr_header_instruction:
@@ -2567,7 +2570,7 @@
   BytePtr oldend, newend;
 =

 #if 0
-  fprintf(stderr, "Start GC  in 0x%lx\n", tcr);
+  fprintf(stderr, "Start GC  in 0x" LISP "\n", tcr);
 #endif
   a =3D active_dynamic_area;
   oldend =3D a->high;
@@ -2576,7 +2579,7 @@
   newfree =3D a->active;
   newend =3D a->high;
 #if 0
-  fprintf(stderr, "End GC  in 0x%lx\n", tcr);
+  fprintf(stderr, "End GC  in 0x" LISP "\n", tcr);
 #endif
   return ((oldfree-newfree)+(newend-oldend));
 }



More information about the Openmcl-cvs-notifications mailing list