1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

print column numbers in backtraces

* module/system/repl/debug.scm (print-frame): Print column numbers too.
This commit is contained in:
Andy Wingo 2010-07-10 12:32:24 +02:00
parent 5273854080
commit 0803914395

View file

@ -84,11 +84,13 @@
"unknown file")) "unknown file"))
(let* ((source (frame-source frame)) (let* ((source (frame-source frame))
(file (source:pretty-file source)) (file (source:pretty-file source))
(line (and=> source source:line))) (line (and=> source source:line))
(col (and=> source source:column)))
(if (and file (not (equal? file (source:pretty-file last-source)))) (if (and file (not (equal? file (source:pretty-file last-source))))
(format port "~&In ~a:~&" file)) (format port "~&In ~a:~&" file))
(format port "~:[~*~6_~;~5d:~]~:[~*~3_~;~3d~] ~v:@y~%" (format port "~9@a~:[~*~3_~;~3d~] ~v:@y~%"
line line index index width (frame-call-representation frame)) (if line (format #f "~a:~a" line col) "")
index index width (frame-call-representation frame))
(if full? (if full?
(print-locals frame #:width width (print-locals frame #:width width
#:per-line-prefix " ")))) #:per-line-prefix " "))))