1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-11 14:21:10 +02:00

fix source location reporting for compiled code

* module/system/repl/repl.scm (default-catch-handler): Cosmetic
  improvements on VM error backtraces.

* module/system/vm/frame.scm (print-frame): Cosmetic improvements.
  (frame-line-number): source:line operates on the handle, not the cdr.
  (print-frame-chain-as-backtrace): Cosmetic improvements.
This commit is contained in:
Andy Wingo 2008-08-09 13:41:23 +02:00
parent 29711eb918
commit fbea69ad42
2 changed files with 5 additions and 5 deletions

View file

@ -61,9 +61,9 @@
((quit . _) ((quit . _)
(apply throw args)) (apply throw args))
((vm-error ,fun ,msg ,args) ((vm-error ,fun ,msg ,args)
(display "VM error: ")
(apply format #t msg args)
(vm-backtrace (the-vm)) (vm-backtrace (the-vm))
(display "\nVM error: \n")
(apply format #t msg args)
(newline)) (newline))
((,key ,subr ,msg ,args . ,rest) ((,key ,subr ,msg ,args . ,rest)
(vm-backtrace (the-vm)) (vm-backtrace (the-vm))

View file

@ -73,7 +73,7 @@
(define (frame-line-number frame) (define (frame-line-number frame)
(let ((addr (frame-address frame))) (let ((addr (frame-address frame)))
(cond ((assv-ref (program-sources (frame-program frame)) addr) (cond ((assv addr (program-sources (frame-program frame)))
=> source:line) => source:line)
(else (format #f "@~a" addr))))) (else (format #f "@~a" addr)))))
@ -85,7 +85,7 @@
"current input")))) "current input"))))
(define (print-frame frame) (define (print-frame frame)
(format #t "~4@a: ~a ~a\n" (frame-line-number frame) (frame-number frame) (format #t "~4@a: ~a ~a\n" (frame-line-number frame) (frame-number frame)
(frame-call-representation frame))) (frame-call-representation frame)))
@ -112,7 +112,7 @@
(format #t "VM backtrace:\n") (format #t "VM backtrace:\n")
(fold (lambda (frame file) (fold (lambda (frame file)
(let ((new-file (frame-file frame file))) (let ((new-file (frame-file frame file)))
(if (not (eqv? new-file file)) (if (not (equal? new-file file))
(format #t "In ~a:\n" new-file)) (format #t "In ~a:\n" new-file))
(print-frame frame) (print-frame frame)
new-file)) new-file))