#| -*-Scheme-*-
-$Id: infutl.scm,v 1.61 1999/02/16 18:48:42 cph Exp $
+$Id: infutl.scm,v 1.62 1999/03/04 05:50:01 cph Exp $
Copyright (c) 1988-1999 Massachusetts Institute of Technology
unspecific)))
(define (read-debugging-info descriptor)
- (cond ((string? descriptor)
+ (cond ((debug-info-pathname? descriptor)
(let ((binf (read-binf-file descriptor)))
(and binf
(if (dbg-info? binf)
(not (zero? (vector-length binf)))
(vector-ref binf 0))))))
((and (pair? descriptor)
- (string? (car descriptor))
+ (debug-info-pathname? (car descriptor))
(exact-nonnegative-integer? (cdr descriptor)))
(let ((binf (read-binf-file (car descriptor))))
(and binf
(if (compiled-closure? entry)
(compiled-entry/offset (compiled-closure->entry entry))
(compiled-code-address->offset entry)))
-
+\f
(define (compiled-entry/filename-and-index entry)
(compiled-code-block/filename-and-index (compiled-entry/block entry)))
(define (compiled-code-block/filename-and-index block)
(let loop ((info (compiled-code-block/debugging-info block)))
- (cond ((string? info) (values (canonicalize-debug-info-filename info) #f))
+ (cond ((debug-info-pathname? info)
+ (values (canonicalize-debug-info-filename info) #f))
((not (pair? info)) (values #f #f))
((dbg-info? (car info)) (loop (cdr info)))
- ((string? (car info))
+ ((debug-info-pathname? (car info))
(values (canonicalize-debug-info-filename (car info))
(and (exact-nonnegative-integer? (cdr info))
(cdr info))))
(pathname-version com-pathname)))
(pathname-new-type com-pathname (pathname-type binf-pathname))
binf-pathname)))))
+
+(define (debug-info-pathname? object)
+ (or (pathname? object)
+ (string? object)))
\f
(define directory-rewriting-rules
'())
;;; Support of BSM files
(define (read-labels descriptor)
- (cond ((string? descriptor)
+ (cond ((debug-info-pathname? descriptor)
(let ((bsm (read-bsm-file descriptor)))
(and bsm ;; bsm are either vectors of pairs or vectors of vectors
(if (vector? bsm)
((vector? first) first)
(else #f)))))))
((and (pair? descriptor)
- (string? (car descriptor))
+ (debug-info-pathname? (car descriptor))
(exact-nonnegative-integer? (cdr descriptor)))
(let ((bsm (read-bsm-file (car descriptor))))
(and bsm