diff options
Diffstat (limited to 'module/system/vm/program.scm')
-rw-r--r-- | module/system/vm/program.scm | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/module/system/vm/program.scm b/module/system/vm/program.scm index 30f8c7ecd..a1e3ea4f0 100644 --- a/module/system/vm/program.scm +++ b/module/system/vm/program.scm @@ -28,6 +28,7 @@ binding:start binding:end source:addr source:line source:column source:file + source:line-for-user program-sources program-source program-bindings program-bindings-by-index program-bindings-for-ip @@ -64,6 +65,12 @@ (define (source:column source) (cdddr source)) +;; Lines are zero-indexed inside Guile, but users expect them to be +;; one-indexed. Columns, on the other hand, are zero-indexed to both. Go +;; figure. +(define (source:line-for-user source) + (1+ (source:line source))) + (define (collapse-locals locs) (let lp ((ret '()) (locs locs)) (if (null? locs) @@ -209,7 +216,7 @@ (number->string (object-address prog) 16) (or (source:file s) (if s "<current input>" "<unknown port>")) - (source:line s) (source:column s)))) + (source:line-for-user s) (source:column s)))) (number->string (object-address prog) 16)) (let ((arities (program-arities prog))) (if (or (not arities) (null? arities)) |