1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-09 13:30:26 +02:00

`(debug)' debugs the current stack.

* module/system/vm/debug.scm (debug): Change to debug the current stack
  instead of the last stack.
This commit is contained in:
Andy Wingo 2010-06-18 13:10:33 +02:00
parent 48201a94eb
commit 5827e220ab

View file

@ -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)))