cs: improve location info in backtrace
Provide paths instead of strings, and include position and span information.
This commit is contained in:
parent
254f6a4f14
commit
4c981258f6
|
@ -480,5 +480,6 @@
|
|||
(set-make-async-callback-poll-wakeup! unsafe-make-signal-received)
|
||||
(set-get-machine-info! get-machine-info)
|
||||
(set-processor-count! (1/processor-count))
|
||||
(set-convert-source-file-descriptor-path! 1/string->path)
|
||||
(install-future-logging-procs! logging-future-events? log-future-event)
|
||||
(install-place-logging-procs! logging-place-events? log-place-event))
|
||||
|
|
|
@ -87,6 +87,7 @@
|
|||
linklet-instantiate-key ; not exported to Racket
|
||||
set-error-display-eprintf! ; not exported to Racket
|
||||
set-log-system-message! ; not exported to Racket
|
||||
set-convert-source-file-descriptor-path! ; not exported to Racket
|
||||
|
||||
current-inspector
|
||||
make-inspector
|
||||
|
|
|
@ -608,21 +608,29 @@
|
|||
[loc (and (cdr p)
|
||||
(call-with-values (lambda ()
|
||||
(let* ([src (cdr p)]
|
||||
[path (source-file-descriptor-path (source-object-sfd src))])
|
||||
[path (convert-source-file-descriptor-path
|
||||
(source-file-descriptor-path (source-object-sfd src)))])
|
||||
(if (source-object-line src)
|
||||
(values path
|
||||
(source-object-line src)
|
||||
(source-object-column src))
|
||||
(source-object-column src)
|
||||
(source-object-bfp src)
|
||||
(source-object-efp src))
|
||||
(values path
|
||||
(source-object-bfp src)))))
|
||||
(source-object-bfp src)
|
||||
(source-object-efp src)))))
|
||||
(case-lambda
|
||||
[() #f]
|
||||
[(path line col) (|#%app| srcloc path line (sub1 col) #f #f)]
|
||||
[(path pos) (|#%app| srcloc path #f #f (add1 pos) #f)])))])
|
||||
[(path line col pos end) (|#%app| srcloc path line (sub1 col) (add1 pos) (- end pos))]
|
||||
[(path pos end) (|#%app| srcloc path #f #f (add1 pos) (- end pos))])))])
|
||||
(if (or name loc)
|
||||
(cons (cons name loc) (loop (cdr l) ls))
|
||||
(loop (cdr l) ls)))])))
|
||||
|
||||
(define convert-source-file-descriptor-path (lambda (s) s))
|
||||
(define (set-convert-source-file-descriptor-path! proc)
|
||||
(set! convert-source-file-descriptor-path proc))
|
||||
|
||||
(define (default-error-display-handler msg v)
|
||||
(eprintf "~a" msg)
|
||||
(when (or (continuation-condition? v)
|
||||
|
|
Loading…
Reference in New Issue
Block a user