1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-12 06:41:13 +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:
Andy Wingo 2010-10-12 13:09:48 +02:00
parent 767dbb1af3
commit a36c3a458e
3 changed files with 7 additions and 6 deletions

View file

@ -617,7 +617,7 @@ Note that the given source location must be inside a procedure."
(format #t "Return values:~%") (format #t "Return values:~%")
(for-each (lambda (x) (repl-print repl x)) vals)))) (for-each (lambda (x) (repl-print repl x)) vals))))
((module-ref (resolve-interface '(system repl repl)) 'start-repl) ((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) (define-stack-command (finish repl)
"finish "finish
@ -641,7 +641,7 @@ Resume execution, breaking when the current frame finishes."
(k (frame->stack-vector frame))))))) (k (frame->stack-vector frame)))))))
(format #t "~a~%" msg) (format #t "~a~%" msg)
((module-ref (resolve-interface '(system repl repl)) 'start-repl) ((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) (define-stack-command (step repl)
"step "step

View file

@ -30,7 +30,8 @@
#:use-module ((system vm inspect) #:select ((inspect . %inspect))) #:use-module ((system vm inspect) #:select ((inspect . %inspect)))
#:use-module (system vm program) #:use-module (system vm program)
#:export (<debug> #: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 print-registers print-locals print-frame print-frames frame->module
stack->vector narrow-stack->vector stack->vector narrow-stack->vector
frame->stack-vector)) frame->stack-vector))
@ -53,7 +54,7 @@
;;; accessors, and provides some helper functions. ;;; accessors, and provides some helper functions.
;;; ;;;
(define-record <debug> frames index error-message) (define-record <debug> frames index error-message for-trap?)

View file

@ -76,7 +76,7 @@
(error-msg (if trap-idx (error-msg (if trap-idx
(format #f "Trap ~d: ~a" trap-idx trap-name) (format #f "Trap ~d: ~a" trap-idx trap-name)
trap-name)) trap-name))
(debug (make-debug stack 0 error-msg))) (debug (make-debug stack 0 error-msg #t)))
(with-saved-ports (with-saved-ports
(lambda () (lambda ()
(if trap-idx (if trap-idx
@ -145,7 +145,7 @@
;; the start-stack thunk has its own frame too. ;; the start-stack thunk has its own frame too.
0 (and tag 1))) 0 (and tag 1)))
(error-msg (error-string stack key args)) (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 (with-saved-ports
(lambda () (lambda ()
(format #t "~a~%" error-msg) (format #t "~a~%" error-msg)