mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-10 14:00:21 +02:00
debug has for-trap? field
* module/system/repl/debug.scm (<debug>): New field, `for-trap?'. True if the stack is for a trap, and thus the top frame should use frame-next-source instead of frame-source. * module/system/repl/command.scm (repl-pop-continuation-resumer) (repl-next-resumer): * module/system/repl/error-handling.scm (call-with-error-handling): Update callers.
This commit is contained in:
parent
767dbb1af3
commit
a36c3a458e
3 changed files with 7 additions and 6 deletions
|
@ -617,7 +617,7 @@ Note that the given source location must be inside a procedure."
|
|||
(format #t "Return values:~%")
|
||||
(for-each (lambda (x) (repl-print repl x)) vals))))
|
||||
((module-ref (resolve-interface '(system repl repl)) 'start-repl)
|
||||
#:debug (make-debug stack 0 msg))))))
|
||||
#:debug (make-debug stack 0 msg #t))))))
|
||||
|
||||
(define-stack-command (finish repl)
|
||||
"finish
|
||||
|
@ -641,7 +641,7 @@ Resume execution, breaking when the current frame finishes."
|
|||
(k (frame->stack-vector frame)))))))
|
||||
(format #t "~a~%" msg)
|
||||
((module-ref (resolve-interface '(system repl repl)) 'start-repl)
|
||||
#:debug (make-debug stack 0 msg)))))
|
||||
#:debug (make-debug stack 0 msg #t)))))
|
||||
|
||||
(define-stack-command (step repl)
|
||||
"step
|
||||
|
|
|
@ -30,7 +30,8 @@
|
|||
#:use-module ((system vm inspect) #:select ((inspect . %inspect)))
|
||||
#:use-module (system vm program)
|
||||
#:export (<debug>
|
||||
make-debug debug? debug-frames debug-index debug-error-message
|
||||
make-debug debug?
|
||||
debug-frames debug-index debug-error-message debug-for-trap?
|
||||
print-registers print-locals print-frame print-frames frame->module
|
||||
stack->vector narrow-stack->vector
|
||||
frame->stack-vector))
|
||||
|
@ -53,7 +54,7 @@
|
|||
;;; accessors, and provides some helper functions.
|
||||
;;;
|
||||
|
||||
(define-record <debug> frames index error-message)
|
||||
(define-record <debug> frames index error-message for-trap?)
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
(error-msg (if trap-idx
|
||||
(format #f "Trap ~d: ~a" trap-idx trap-name)
|
||||
trap-name))
|
||||
(debug (make-debug stack 0 error-msg)))
|
||||
(debug (make-debug stack 0 error-msg #t)))
|
||||
(with-saved-ports
|
||||
(lambda ()
|
||||
(if trap-idx
|
||||
|
@ -145,7 +145,7 @@
|
|||
;; the start-stack thunk has its own frame too.
|
||||
0 (and tag 1)))
|
||||
(error-msg (error-string stack key args))
|
||||
(debug (make-debug stack 0 error-msg)))
|
||||
(debug (make-debug stack 0 error-msg #f)))
|
||||
(with-saved-ports
|
||||
(lambda ()
|
||||
(format #t "~a~%" error-msg)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue