#| -*-Scheme-*-
-$Id: conpar.scm,v 14.37 1996/07/26 00:34:49 adams Exp $
+$Id: conpar.scm,v 14.38 1997/07/12 04:23:26 adams Exp $
Copyright (c) 1988-95 Massachusetts Institute of Technology
(write-string " within ")
(write (stack-frame/ref frame hardware-trap/pc-info1-index)))
((2) ; compiled code
- (write-string " at offset ")
- (write-hex (stack-frame/ref frame hardware-trap/pc-info2-index))
- (newline)
- (write-string "within ")
- (let ((block (stack-frame/ref frame hardware-trap/pc-info1-index)))
+ (let ((block (stack-frame/ref frame hardware-trap/pc-info1-index))
+ (offset (stack-frame/ref frame hardware-trap/pc-info2-index)))
+ (write-string " at offset ")
+ (write-hex offset)
+ (newline)
+ (write-string "within ")
(write block)
- (let loop ((info (compiled-code-block/debugging-info block)))
- (cond ((null? info)
- false)
- ((string? info)
- (begin
- (write-string " (")
- (write-string info)
- (write-string ")")))
- ((not (pair? info))
- false)
- ((string? (car info))
- (loop (car info)))
- (else
- (loop (cdr info)))))))
+ (let ((descriptor (compiled-code-block/dbg-descriptor block)))
+ (if descriptor
+ (begin
+ (write-string " (")
+ (display (dbg-locator/file (car descriptor)))
+ (flush-output) ; incase following is slow...
+ (let ((name (compiled-code-block/name block offset)))
+ (if name
+ (begin
+ (write-string " ")
+ (display name))))
+ (write-string ")"))))))
((3) ; probably compiled-code
(write-string " at an unknown compiled-code location."))
((4) ; builtin (i.e. hook)
#| -*-Scheme-*-
-$Id: infutl.scm,v 1.61 1995/08/02 20:47:38 adams Exp $
+$Id: infutl.scm,v 1.62 1997/07/12 04:23:16 adams Exp $
-Copyright (c) 1988-95 Massachusetts Institute of Technology
+Copyright (c) 1988-97 Massachusetts Institute of Technology
This material was developed by the Scheme project at the Massachusetts
Institute of Technology, Department of Electrical Engineering and
(or (special-form-procedure-name? name)
(symbol->string name))))))
+(define (compiled-code-block/name block offset)
+ ;; Try to come up with a name for BLOCK. If there is one top-level
+ ;; procedure, use its name.
+ (define (top-level-proc-name proc)
+ (and (dbg-block? (dbg-procedure/block proc))
+ (eq? 'IC (dbg-block/parent (dbg-procedure/block proc)))
+ (let ((name (dbg-procedure/name proc)))
+ (or (special-form-procedure-name? name)
+ name))))
+ offset ; ignored
+ (let ((dbg-info
+ (compiled-code-block/dbg-info block load-debugging-info-on-demand?)))
+ (and dbg-info
+ (not (dbg-info/expression dbg-info)) ; top level or group compiled
+ (let ((procs (dbg-info/procedures dbg-info)))
+ (let loop ((i 0) (name #F))
+ (cond ((= i (vector-length procs)) name)
+ ((top-level-proc-name (vector-ref procs i))
+ => (lambda (name*)
+ (and (not name)
+ (loop (+ i 1) name*))))
+ (else (loop (+ i 1) name))))))))
+
(define load-debugging-info-on-demand?
false)
#| -*-Scheme-*-
-$Id: runtime.pkg,v 14.289 1997/06/25 03:28:26 cph Exp $
+$Id: runtime.pkg,v 14.290 1997/07/12 04:23:04 adams Exp $
Copyright (c) 1988-97 Massachusetts Institute of Technology
dbg-expression?)
(export (runtime unparser)
compiled-entry/filename-and-index)
+ (export (runtime continuation-parser)
+ compiled-code-block/dbg-descriptor
+ compiled-code-block/name
+ dbg-locator/file)
(export (runtime compress)
uncompress-internal)
(initialization (initialize-package!)))