Narrow one more frame in debug.scm:debug-pre-unwind-handler
authorAndy Wingo <wingo@pobox.com>
Sat, 9 Jan 2010 19:40:36 +0000 (20:40 +0100)
committerAndy Wingo <wingo@pobox.com>
Sat, 9 Jan 2010 19:40:36 +0000 (20:40 +0100)
* module/system/vm/debug.scm (debug-pre-unwind-handler): Narrow two
  frames instead of stack-reffing past one. The second frame is
  necessary, now that make-stack itself is on the stack.

module/system/vm/debug.scm

index 938dca74efc7ef9e576737218aa7782afc09f6bc..935a938ded15072dc63d8f70767bfe18b900cf50 100644 (file)
@@ -367,7 +367,7 @@ With an argument, select a frame by index, then show it."
 ;; (state associated with vm ?)
 
 (define (debug-pre-unwind-handler key . args)
-  (let ((stack (make-stack #t)))
+  (let ((stack (make-stack #t debug-pre-unwind-handler)))
     (pmatch args
       ((,subr ,msg ,args . ,rest)
        (format #t "Throw to key `~a':\n" key)
@@ -375,6 +375,6 @@ With an argument, select a frame by index, then show it."
       (else
        (format #t "Throw to key `~a' with args `~s'." key args)))
     (format #t "Entering the debugger. Type `bt' for a backtrace or `c' to continue.\n")
-    (run-debugger (stack-ref stack 1)))
-  (save-stack 1)
+    (run-debugger (stack-ref stack 0)))
+  (save-stack debug-pre-unwind-handler)
   (apply throw key args))