mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-03 13:20:26 +02:00
(system repl debug): add frame->stack-vector
* module/system/repl/debug.scm (frame->stack-vector): New public function.
This commit is contained in:
parent
2c04cf390b
commit
586aff5a27
1 changed files with 17 additions and 1 deletions
|
@ -32,7 +32,8 @@
|
||||||
#:export (<debug>
|
#:export (<debug>
|
||||||
make-debug debug? debug-frames debug-index debug-error-message
|
make-debug debug? debug-frames debug-index debug-error-message
|
||||||
print-registers print-locals print-frame print-frames frame->module
|
print-registers print-locals print-frame print-frames frame->module
|
||||||
stack->vector narrow-stack->vector))
|
stack->vector narrow-stack->vector
|
||||||
|
frame->stack-vector))
|
||||||
|
|
||||||
;; TODO:
|
;; TODO:
|
||||||
;;
|
;;
|
||||||
|
@ -181,6 +182,21 @@
|
||||||
(stack->vector narrowed)
|
(stack->vector narrowed)
|
||||||
#()))) ; ? Can be the case for a tail-call to `throw' tho
|
#()))) ; ? Can be the case for a tail-call to `throw' tho
|
||||||
|
|
||||||
|
(define (frame->stack-vector frame)
|
||||||
|
(let ((tag (and (pair? (fluid-ref %stacks))
|
||||||
|
(cdar (fluid-ref %stacks)))))
|
||||||
|
(narrow-stack->vector
|
||||||
|
(make-stack frame)
|
||||||
|
;; Take the stack from the given frame, cutting 0
|
||||||
|
;; frames.
|
||||||
|
0
|
||||||
|
;; Narrow the end of the stack to the most recent
|
||||||
|
;; start-stack.
|
||||||
|
tag
|
||||||
|
;; And one more frame, because %start-stack
|
||||||
|
;; invoking the start-stack thunk has its own frame
|
||||||
|
;; too.
|
||||||
|
0 (and tag 1))))
|
||||||
|
|
||||||
;; (define (debug)
|
;; (define (debug)
|
||||||
;; (run-debugger
|
;; (run-debugger
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue