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

Fix first find-program-sources result

* module/system/vm/debug.scm (find-program-sources): Manually set the pc
  of the first result in a function.
This commit is contained in:
Andy Wingo 2013-11-06 17:33:43 +01:00
parent 111a305be8
commit 963d95f1d9

View file

@ -530,8 +530,16 @@ section of the ELF image. Returns an ELF symbol, or @code{#f}."
(line-prog-advance prog))) (line-prog-advance prog)))
(lambda (pc file line col) (lambda (pc file line col)
(if (and pc (< pc high-pc)) (if (and pc (< pc high-pc))
(lp (cons (make-source/dwarf (+ pc base) file line col) ;; For the first source, it's probable that the
sources)) ;; address of the line program is before the
;; low-pc, since the line program is for the
;; entire compilation unit, and there are no
;; redundant "rows" in the line program.
;; Therefore in that case use the addr of low-pc
;; instead of the one we got back.
(let ((addr (+ (if (null? sources) low-pc pc) base)))
(lp (cons (make-source/dwarf addr file line col)
sources)))
(reverse sources)))))) (reverse sources))))))
(else '()))))) (else '())))))
(else '()))) (else '())))