summaryrefslogtreecommitdiff
path: root/module
diff options
context:
space:
mode:
Diffstat (limited to 'module')
-rw-r--r--module/system/vm/debug.scm12
1 files changed, 8 insertions, 4 deletions
diff --git a/module/system/vm/debug.scm b/module/system/vm/debug.scm
index 815135647..dfc7140d8 100644
--- a/module/system/vm/debug.scm
+++ b/module/system/vm/debug.scm
@@ -446,10 +446,14 @@ With an argument, select a frame by index, then show it."
v))
(define (debug)
- (let ((stack (fluid-ref the-last-stack)))
- (if stack
- (run-debugger (stack->vector stack))
- (display "Nothing to debug.\n" (debug-output-port)))))
+ (run-debugger
+ (narrow-stack->vector
+ (make-stack #t)
+ ;; Narrow the `make-stack' frame and the `debug' frame
+ 2
+ ;; Narrow the end of the stack to the most recent start-stack.
+ (and (pair? (fluid-ref %stacks))
+ (cdar (fluid-ref %stacks))))))
(define (narrow-stack->vector stack . args)
(stack->vector (apply make-stack (stack-ref stack 0) args)))