1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 20:00:19 +02:00

anonymous RTl functions print with source info

* module/system/vm/debug.scm (find-program-sources): If there is no
  source location before the low-pc of the procedure we're grovelling
  for, we were skipping the source loc info.  Fix that.

* module/system/vm/program.scm (write-program): Get source info for
  anonymous RTL functions.
  (program-sources, program-sources-pre-retire): Provide program
  counters relative to the beginning of the procedure.
This commit is contained in:
Andy Wingo 2013-10-03 22:48:17 +02:00
parent 7c54029740
commit b43e81dc60
2 changed files with 7 additions and 5 deletions

View file

@ -506,9 +506,11 @@ section of the ELF image. Returns an ELF symbol, or @code{#f}."
(line-prog (ctx-die (die-ctx die))))))))
(cond
((and low-pc high-pc prog)
(line-prog-scan-to-pc prog (1- low-pc))
(let lp ((sources '()))
(call-with-values (lambda () (line-prog-advance prog))
(call-with-values (lambda ()
(if (null? sources)
(line-prog-scan-to-pc prog low-pc)
(line-prog-advance prog)))
(lambda (pc file line col)
(if (and pc (< pc high-pc))
(lp (cons (make-source/dwarf (+ pc base) file line col)

View file

@ -123,7 +123,7 @@
(cond
((rtl-program? proc)
(map (lambda (source)
(cons* (source-post-pc source)
(cons* (- (source-post-pc source) (rtl-program-code proc))
(source-file source)
(source-line source)
(source-column source)))
@ -154,7 +154,7 @@
(cond
((rtl-program? proc)
(map (lambda (source)
(cons* (source-pre-pc source)
(cons* (- (source-pre-pc source) (rtl-program-code proc))
(source-file source)
(source-line source)
(source-column source)))
@ -331,7 +331,7 @@
(define (write-program prog port)
(define (program-identity-string)
(or (procedure-name prog)
(and=> (and (program? prog) (program-source prog 0))
(and=> (program-source prog 0)
(lambda (s)
(format #f "~a at ~a:~a:~a"
(number->string (object-address prog) 16)