made debugger handle errors in printing *DEBUG-CONDITION*
[sbcl.git] / src / runtime / interrupt.c
index fdf1ab2..616bc78 100644 (file)
  * files for more information.
  */
 
-/*
- * $Header$
- */
-
 #include <stdio.h>
 
 #include <signal.h>
@@ -80,11 +76,12 @@ os_context_t *lisp_interrupt_contexts[MAX_INTERRUPTS];
  * However, some signals need special handling, e.g. the SIGSEGV (for
  * Linux) or SIGBUS (for FreeBSD) used by the garbage collector to
  * detect violations of write protection, because some cases of such
- * signals are handled at C level and never passed on to Lisp. For
- * such signals, we still store any Lisp-level handler in
- * interrupt_handlers[..], but for the outermost handle we use the
- * value from interrupt_low_level_handlers[..], instead of the
- * ordinary interrupt_handle_now(..) or interrupt_handle_later(..).
+ * signals (e.g. GC-related violations of write protection) are
+ * handled at C level and never passed on to Lisp. For such signals,
+ * we still store any Lisp-level handler in interrupt_handlers[..],
+ * but for the outermost handle we use the value from
+ * interrupt_low_level_handlers[..], instead of the ordinary
+ * interrupt_handle_now(..) or interrupt_handle_later(..).
  *
  * -- WHN 20000728 */
 void (*interrupt_low_level_handlers[NSIG]) (int, siginfo_t*, void*) = {0};
@@ -113,11 +110,11 @@ fake_foreign_function_call(os_context_t *context)
 
     /* Get current Lisp state from context. */
 #ifdef reg_ALLOC
-    current_dynamic_space_free_pointer =
+    dynamic_space_free_pointer =
        (lispobj *)(*os_context_register_addr(context, reg_ALLOC));
 #ifdef alpha
-    if ((long)current_dynamic_space_free_pointer & 1) {
-      lose("dead in fake_foreign_function_call, context = %x", context);
+    if ((long)dynamic_space_free_pointer & 1) {
+       lose("dead in fake_foreign_function_call, context = %x", context);
     }
 #endif
 #endif
@@ -152,12 +149,13 @@ fake_foreign_function_call(os_context_t *context)
             oldcont = (lispobj)(*os_context_register_addr(context, reg_OCFP));
         }
     }
-    /* ### We can't tell if we are still in the caller if it had to
-     * reg_ALLOCate the stack frame due to stack arguments. */
+    /* ### We can't tell whether we are still in the caller if it had
+     * to reg_ALLOCate the stack frame due to stack arguments. */
     /* ### Can anything strange happen during return? */
-    else
+    else {
         /* normal case */
         oldcont = (lispobj)(*os_context_register_addr(context, reg_CFP));
+    }
 
     current_control_stack_pointer = current_control_frame_pointer + 8;
 
@@ -212,7 +210,7 @@ undo_fake_foreign_function_call(os_context_t *context)
 #ifdef reg_ALLOC
     /* Put the dynamic space free pointer back into the context. */
     *os_context_register_addr(context, reg_ALLOC) =
-        (unsigned long) current_dynamic_space_free_pointer;
+        (unsigned long) dynamic_space_free_pointer;
 #endif
 }
 
@@ -447,7 +445,7 @@ gc_trigger_hit(int signal, siginfo_t *info, os_context_t *context)
                                                      context);
 
        return (badaddr >= current_auto_gc_trigger &&
-               badaddr < current_dynamic_space + DYNAMIC_SPACE_SIZE);
+               badaddr < DYNAMIC_SPACE_START + DYNAMIC_SPACE_SIZE);
     }
 }
 #endif