Fix some bugs related to compiled code debugging when no debugging
authorChris Hanson <org/chris-hanson/cph>
Fri, 30 Dec 1988 23:30:21 +0000 (23:30 +0000)
committerChris Hanson <org/chris-hanson/cph>
Fri, 30 Dec 1988 23:30:21 +0000 (23:30 +0000)
info is available.  Change cold load to cause updating of debugging
information for the runtime system.  Fix demand loading so that, when
disabled, procedure names are shown when the debugging information is
already loaded.  Discard debugging info before doing disk-save.

v7/src/runtime/dbgutl.scm
v7/src/runtime/debug.scm
v7/src/runtime/infutl.scm
v7/src/runtime/make.scm
v7/src/runtime/runtime.pkg
v7/src/runtime/savres.scm
v8/src/runtime/dbgutl.scm
v8/src/runtime/infutl.scm
v8/src/runtime/make.scm
v8/src/runtime/runtime.pkg

index b5c2e8695b318f9e86f39dbae52b1c4d6d74c7d6..c52da1fbcd28f2c7cb22567e80ab0888f38b85fd 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/dbgutl.scm,v 14.4 1988/12/30 06:42:27 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/dbgutl.scm,v 14.5 1988/12/30 23:29:46 cph Exp $
 
 Copyright (c) 1988 Massachusetts Institute of Technology
 
@@ -37,33 +37,39 @@ MIT in each case. |#
 
 (declare (usual-integrations))
 \f
-(define (initialize-package!)
-  (set! rename-list
-       `((,lambda-tag:unnamed . LAMBDA)
-         (,lambda-tag:internal-lambda . LAMBDA)
-         (,lambda-tag:internal-lexpr . LAMBDA)
-         (,lambda-tag:let . LET)
-         (,lambda-tag:fluid-let . FLUID-LET)
-         (,lambda-tag:make-environment . MAKE-ENVIRONMENT))))
-
 (define (print-user-friendly-name environment)
   (let ((name (environment-procedure-name environment)))
     (if name
-       (let ((rename (special-name? name)))
+       (let ((rename (special-form-procedure-name? name)))
          (if rename
              (begin (write-string "a ")
-                    (write (cdr rename))
+                    (write-string rename)
                     (write-string " special form"))
              (begin (write-string "the procedure ")
                     (write-dbg-name name))))
        (write-string "an unknown procedure"))))
 
-(define (special-name? name)
-  (list-search-positive rename-list
-    (lambda (association)
-      (dbg-name=? (car association) name))))
+(define (show-frames environment depth)
+  (let loop ((environment environment) (depth depth))
+    (show-frame environment depth true)
+    (if (environment-has-parent? environment)
+       (begin
+         (newline)
+         (loop (environment-parent environment) (1+ depth))))))
+
+(define (write-dbg-name name)
+  (if (string? name) (write-string name) (write name)))
 
-(define rename-list)
+(define (debug/read-eval-print-1 environment)
+  (let ((value (debug/eval (prompt-for-expression "Eval--> ") environment)))
+    (newline)
+    (write value)))
+
+(define (output-to-string length thunk)
+  (let ((x (with-output-to-truncated-string length thunk)))
+    (if (and (car x) (> length 4))
+       (substring-move-right! " ..." 0 4 (cdr x) (- length 4)))
+    (cdr x)))
 \f
 (define (show-frame environment depth brief?)
   (write-string "Environment ")
@@ -114,14 +120,6 @@ MIT in each case. |#
 (define brief-bindings-limit
   16)
 
-(define (show-frames environment depth)
-  (let loop ((environment environment) (depth depth))
-    (show-frame environment depth true)
-    (if (environment-has-parent? environment)
-       (begin
-         (newline)
-         (loop (environment-parent environment) (1+ depth))))))
-
 (define (print-binding name value)
   (let ((x-size (output-port/x-size (current-output-port))))
     (newline)
@@ -137,18 +135,4 @@ MIT in each case. |#
              s
              (output-to-string (max (- x-size (string-length s)) 0)
                (lambda ()
-                 (write value))))))))))
-
-(define (output-to-string length thunk)
-  (let ((x (with-output-to-truncated-string length thunk)))
-    (if (and (car x) (> length 4))
-       (substring-move-right! " ..." 0 4 (cdr x) (- length 4)))
-    (cdr x)))
-
-(define (write-dbg-name name)
-  (if (string? name) (write-string name) (write name)))
-
-(define (debug/read-eval-print-1 environment)
-  (let ((value (debug/eval (prompt-for-expression "Eval--> ") environment)))
-    (newline)
-    (write value)))
\ No newline at end of file
+                 (write value))))))))))
\ No newline at end of file
index f8e8c4e6bc6bfd8f4c89d415b8dc4b67d82aa5ff..9acbb9a796454ca84a6feee41c62c53ddcb8dd98 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/debug.scm,v 14.6 1988/12/30 06:42:33 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/debug.scm,v 14.7 1988/12/30 23:29:54 cph Exp $
 
 Copyright (c) 1988 Massachusetts Institute of Technology
 
@@ -254,7 +254,7 @@ MIT in each case. |#
           (and (environment? environment)
                (environment-procedure-name environment))))
       (if (or (not name)
-             (special-name? name))
+             (special-form-procedure-name? name))
          ""
          (output-to-string 20 (lambda () (write-dbg-name name)))))
     20))
index 208b9b2eba7b4bc4ae1eefa7f9c9c523c6d42b66..2775a9199c1b2c5fe0887a42b563db2c3c891bc8 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/infutl.scm,v 1.4 1988/12/30 06:42:46 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/infutl.scm,v 1.5 1988/12/30 23:30:00 cph Exp $
 
 Copyright (c) 1988 Massachusetts Institute of Technology
 
@@ -38,14 +38,26 @@ MIT in each case. |#
 (declare (usual-integrations))
 (declare (integrate-external "infstr"))
 \f
-(define (compiled-code-block/dbg-info block)
+(define (initialize-package!)
+  (set! blocks-with-memoized-debugging-info (make-population))
+  (set! special-form-procedure-names
+       `((,lambda-tag:unnamed . LAMBDA)
+         (,lambda-tag:internal-lambda . LAMBDA)
+         (,lambda-tag:internal-lexpr . LAMBDA)
+         (,lambda-tag:let . LET)
+         (,lambda-tag:fluid-let . FLUID-LET)
+         (,lambda-tag:make-environment . MAKE-ENVIRONMENT)))
+  unspecific)
+
+(define (compiled-code-block/dbg-info block demand-load?)
   (let ((old-info (compiled-code-block/debugging-info block)))
     (if (and (pair? old-info) (dbg-info? (car old-info)))
        (car old-info)
-       (let ((dbg-info (read-debugging-info old-info)))
-         (if dbg-info
-             (memoize-debugging-info! block dbg-info))
-         dbg-info))))
+       (and demand-load?
+            (let ((dbg-info (read-debugging-info old-info)))
+              (if dbg-info
+                  (memoize-debugging-info! block dbg-info))
+              dbg-info)))))
 
 (define (discard-debugging-info!)
   (without-interrupts
@@ -94,32 +106,33 @@ MIT in each case. |#
        (set-compiled-code-block/debugging-info! block (cdr old-info)))))
 
 (define blocks-with-memoized-debugging-info)
-
-(define (initialize-package!)
-  (set! blocks-with-memoized-debugging-info (make-population))
-  unspecific)
 \f
-(define (compiled-entry/dbg-object entry)
+(define (compiled-entry/dbg-object entry #!optional demand-load?)
   (let ((block (compiled-entry/block entry))
        (offset (compiled-entry/offset entry)))
-    (let ((dbg-info (compiled-code-block/dbg-info block)))
-      (discriminate-compiled-entry entry
-       (lambda ()
-         (vector-binary-search (dbg-info/procedures dbg-info)
-                               <
-                               dbg-procedure/label-offset
-                               offset))
-       (lambda ()
-         (vector-binary-search (dbg-info/continuations dbg-info)
-                               <
-                               dbg-continuation/label-offset
-                               offset))
-       (lambda ()
-         (let ((expression (dbg-info/expression dbg-info)))
-           (and (= offset (dbg-expression/label-offset expression))
-                expression)))
-       (lambda ()
-         false)))))
+    (let ((dbg-info
+          (compiled-code-block/dbg-info block
+                                        (if (default-object? demand-load?)
+                                            false
+                                            demand-load?))))
+      (and dbg-info
+          (discriminate-compiled-entry entry
+            (lambda ()
+              (vector-binary-search (dbg-info/procedures dbg-info)
+                                    <
+                                    dbg-procedure/label-offset
+                                    offset))
+            (lambda ()
+              (vector-binary-search (dbg-info/continuations dbg-info)
+                                    <
+                                    dbg-continuation/label-offset
+                                    offset))
+            (lambda ()
+              (let ((expression (dbg-info/expression dbg-info)))
+                (and (= offset (dbg-expression/label-offset expression))
+                     expression)))
+            (lambda ()
+              false))))))
 
 (define (compiled-entry/block entry)
   (if (compiled-closure? entry)
@@ -144,15 +157,6 @@ MIT in each case. |#
          (else
           false))))
 
-(define (compiled-procedure/name entry)
-  (and *compiler-info/load-on-demand?*
-       (let ((procedure (compiled-entry/dbg-object entry)))
-        (and procedure
-             (dbg-procedure/name procedure)))))
-
-(define *compiler-info/load-on-demand?*
-  false)
-
 (define (dbg-labels/find-offset labels offset)
   (vector-binary-search labels < dbg-label/offset offset))
 
@@ -277,4 +281,24 @@ MIT in each case. |#
        ((object-type? (ucode-type uninterned-symbol) name)
         (write-to-string name))
        (else
-        (error "Illegal dbg-name" name))))
\ No newline at end of file
+        (error "Illegal dbg-name" name))))
+
+  (let ((procedure
+        (compiled-entry/dbg-object entry *compiler-info/load-on-demand?*)))
+  (let ((procedure (compiled-entry/dbg-object entry)))
+    (and procedure
+        (let ((name (dbg-procedure/name procedure)))
+          (or (special-form-procedure-name? name)
+              name)))))
+(define *compiler-info/load-on-demand?*
+  false)
+
+
+(define (special-form-procedure-name? name)
+  (let ((association
+        (list-search-positive special-form-procedure-names
+          (lambda (association)
+            (dbg-name=? (car association) name)))))
+    (and association
+        (symbol->string (cdr association)))))
+(define special-form-procedure-names)  entry)))
\ No newline at end of file
index f5599a150881ba94854bfe29aff9729b3838a602..fffe4ad324ce906b7c9c97f1b54cbe5386cd979d 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/make.scm,v 14.5 1988/10/29 00:12:33 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/make.scm,v 14.6 1988/12/30 23:30:07 cph Exp $
 
 Copyright (c) 1988 Massachusetts Institute of Technology
 
@@ -140,13 +140,20 @@ MIT in each case. |#
 \f
 ;;;; Utilities
 
-(define (fasload filename)
+(define fasload-saved-values
+  '())
+
+(define (fasload filename save-value?)
   (tty-write-char newline-char)
   (tty-write-string filename)
   (tty-flush-output)
   (let ((value (binary-fasload filename)))
     (tty-write-string " loaded")
     (tty-flush-output)
+    (if save-value?
+       (set! fasload-saved-values
+             (cons (cons filename value)
+                   fasload-saved-values)))
     value))
 
 (define (eval object environment)
@@ -223,7 +230,7 @@ MIT in each case. |#
 \f
 ;; Construct the package structure.
 ;; Lotta hair here to load the package code before its package is built.
-(eval (cold-load/purify (fasload (map-filename "packag")))
+(eval (cold-load/purify (fasload (map-filename "packag") true))
       environment-for-package)
 ((access initialize-package! environment-for-package))
 (let loop ((names
@@ -246,7 +253,7 @@ MIT in each case. |#
                                    (car names))
             (loop (cdr names)))))
 (package/add-child! system-global-package 'PACKAGE environment-for-package)
-(eval (fasload "runtim.bcon") system-global-environment)
+(eval (fasload "runtim.bcon" false) system-global-environment)
 
 ;; Global databases.  Load, then initialize.
 (let loop
@@ -261,7 +268,8 @@ MIT in each case. |#
        ("gc" . (RUNTIME GARBAGE-COLLECTOR)))))
   (if (not (null? files))
       (begin
-       (eval (cold-load/purify (fasload (map-filename (car (car files)))))
+       (eval (cold-load/purify
+              (fasload (map-filename (car (car files))) true))
              (package-reference (cdr (car files))))
        (loop (cdr files)))))
 (package-initialize '(RUNTIME GC-DAEMONS) 'INITIALIZE-PACKAGE!)
@@ -279,7 +287,7 @@ MIT in each case. |#
                    constant-space/base)
 
 ;; Load everything else.
-((eval (fasload "runtim.bldr") system-global-environment)
+((eval (fasload "runtim.bldr" false) system-global-environment)
  (lambda (filename environment)
    (if (not (or (string=? filename "packag")
                (string=? filename "gcdemn")
@@ -290,7 +298,7 @@ MIT in each case. |#
                (string=? filename "boot")
                (string=? filename "queue")
                (string=? filename "gc")))
-       (eval (purify (fasload (map-filename filename))) environment)))
+       (eval (purify (fasload (map-filename filename) true)) environment)))
  `((SORT-TYPE . MERGE-SORT)
    (OS-TYPE . ,(string->symbol (string-upcase os-name-string)))
    (OPTIONS . NO-LOAD)))
@@ -367,6 +375,14 @@ MIT in each case. |#
    ;; Emacs -- last because it grabs the kitchen sink.
    (RUNTIME EMACS-INTERFACE)
    ))
+\f
+(let ((fasload/update-debugging-info!
+       (access fasload/update-debugging-info!
+              (->environment '(RUNTIME COMPILER-INFO)))))
+  (for-each (lambda (entry)
+             (fasload/update-debugging-info! (cdr entry)
+                                             (->pathname (car entry))))
+           fasload-saved-values))
 
 )
 
index 146923908cf934a2feb984b88e831bfb9fa61a66..c2af422d9d35768ce33b834f638737e4b2764513 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/runtime.pkg,v 14.23 1988/12/30 06:43:14 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/runtime.pkg,v 14.24 1988/12/30 23:30:13 cph Exp $
 
 Copyright (c) 1988 Massachusetts Institute of Technology
 
@@ -218,9 +218,8 @@ MIT in each case. |#
          compiled-procedure/name
          discard-debugging-info!)
   (export (runtime load)         fasload/update-debugging-info!)
-  (export (runtime debugger-utilities)
-         dbg-name<?
-         dbg-name=?)
+  (export (runtime debugger-command-loop)
+         special-form-procedure-name?)
   (export (runtime environment)
          dbg-block/find-name
          dbg-block/ic-parent-index
@@ -359,7 +358,6 @@ MIT in each case. |#
          show-environment-bindings
          show-frame
          show-frames
-         special-name?
          write-dbg-name)
   (initialization (initialize-package!)))
 
index 484e62e8f1bc5c82fb4cc650394bca0142386585..3f6764633a0dc38a956082362618117e6a7556fc 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/savres.scm,v 14.6 1988/10/21 00:17:34 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/savres.scm,v 14.7 1988/12/30 23:30:21 cph Exp $
 
 Copyright (c) 1988 Massachusetts Institute of Technology
 
@@ -61,6 +61,7 @@ MIT in each case. |#
     (let ((identify
           (if (default-object? identify) world-identification identify))
          (time (get-decoded-time)))
+      (discard-debugging-info!)
       (gc-flip)
       (trigger-secondary-gc-daemons!)
       (save-image filename
index 43cbfad783f1b6c93c0421248d6fd066c9b1d2cd..e5dd43ecc8255c211093acd07ef571ef89add467 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/runtime/dbgutl.scm,v 14.4 1988/12/30 06:42:27 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/runtime/dbgutl.scm,v 14.5 1988/12/30 23:29:46 cph Exp $
 
 Copyright (c) 1988 Massachusetts Institute of Technology
 
@@ -37,33 +37,39 @@ MIT in each case. |#
 
 (declare (usual-integrations))
 \f
-(define (initialize-package!)
-  (set! rename-list
-       `((,lambda-tag:unnamed . LAMBDA)
-         (,lambda-tag:internal-lambda . LAMBDA)
-         (,lambda-tag:internal-lexpr . LAMBDA)
-         (,lambda-tag:let . LET)
-         (,lambda-tag:fluid-let . FLUID-LET)
-         (,lambda-tag:make-environment . MAKE-ENVIRONMENT))))
-
 (define (print-user-friendly-name environment)
   (let ((name (environment-procedure-name environment)))
     (if name
-       (let ((rename (special-name? name)))
+       (let ((rename (special-form-procedure-name? name)))
          (if rename
              (begin (write-string "a ")
-                    (write (cdr rename))
+                    (write-string rename)
                     (write-string " special form"))
              (begin (write-string "the procedure ")
                     (write-dbg-name name))))
        (write-string "an unknown procedure"))))
 
-(define (special-name? name)
-  (list-search-positive rename-list
-    (lambda (association)
-      (dbg-name=? (car association) name))))
+(define (show-frames environment depth)
+  (let loop ((environment environment) (depth depth))
+    (show-frame environment depth true)
+    (if (environment-has-parent? environment)
+       (begin
+         (newline)
+         (loop (environment-parent environment) (1+ depth))))))
+
+(define (write-dbg-name name)
+  (if (string? name) (write-string name) (write name)))
 
-(define rename-list)
+(define (debug/read-eval-print-1 environment)
+  (let ((value (debug/eval (prompt-for-expression "Eval--> ") environment)))
+    (newline)
+    (write value)))
+
+(define (output-to-string length thunk)
+  (let ((x (with-output-to-truncated-string length thunk)))
+    (if (and (car x) (> length 4))
+       (substring-move-right! " ..." 0 4 (cdr x) (- length 4)))
+    (cdr x)))
 \f
 (define (show-frame environment depth brief?)
   (write-string "Environment ")
@@ -114,14 +120,6 @@ MIT in each case. |#
 (define brief-bindings-limit
   16)
 
-(define (show-frames environment depth)
-  (let loop ((environment environment) (depth depth))
-    (show-frame environment depth true)
-    (if (environment-has-parent? environment)
-       (begin
-         (newline)
-         (loop (environment-parent environment) (1+ depth))))))
-
 (define (print-binding name value)
   (let ((x-size (output-port/x-size (current-output-port))))
     (newline)
@@ -137,18 +135,4 @@ MIT in each case. |#
              s
              (output-to-string (max (- x-size (string-length s)) 0)
                (lambda ()
-                 (write value))))))))))
-
-(define (output-to-string length thunk)
-  (let ((x (with-output-to-truncated-string length thunk)))
-    (if (and (car x) (> length 4))
-       (substring-move-right! " ..." 0 4 (cdr x) (- length 4)))
-    (cdr x)))
-
-(define (write-dbg-name name)
-  (if (string? name) (write-string name) (write name)))
-
-(define (debug/read-eval-print-1 environment)
-  (let ((value (debug/eval (prompt-for-expression "Eval--> ") environment)))
-    (newline)
-    (write value)))
\ No newline at end of file
+                 (write value))))))))))
\ No newline at end of file
index 75ca621ef07137f5b3cb80313ced75a8f13ab09a..8633e2bdd5cf3320b48db87c3eb8f791e8967471 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/runtime/infutl.scm,v 1.4 1988/12/30 06:42:46 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/runtime/infutl.scm,v 1.5 1988/12/30 23:30:00 cph Exp $
 
 Copyright (c) 1988 Massachusetts Institute of Technology
 
@@ -38,14 +38,26 @@ MIT in each case. |#
 (declare (usual-integrations))
 (declare (integrate-external "infstr"))
 \f
-(define (compiled-code-block/dbg-info block)
+(define (initialize-package!)
+  (set! blocks-with-memoized-debugging-info (make-population))
+  (set! special-form-procedure-names
+       `((,lambda-tag:unnamed . LAMBDA)
+         (,lambda-tag:internal-lambda . LAMBDA)
+         (,lambda-tag:internal-lexpr . LAMBDA)
+         (,lambda-tag:let . LET)
+         (,lambda-tag:fluid-let . FLUID-LET)
+         (,lambda-tag:make-environment . MAKE-ENVIRONMENT)))
+  unspecific)
+
+(define (compiled-code-block/dbg-info block demand-load?)
   (let ((old-info (compiled-code-block/debugging-info block)))
     (if (and (pair? old-info) (dbg-info? (car old-info)))
        (car old-info)
-       (let ((dbg-info (read-debugging-info old-info)))
-         (if dbg-info
-             (memoize-debugging-info! block dbg-info))
-         dbg-info))))
+       (and demand-load?
+            (let ((dbg-info (read-debugging-info old-info)))
+              (if dbg-info
+                  (memoize-debugging-info! block dbg-info))
+              dbg-info)))))
 
 (define (discard-debugging-info!)
   (without-interrupts
@@ -94,32 +106,33 @@ MIT in each case. |#
        (set-compiled-code-block/debugging-info! block (cdr old-info)))))
 
 (define blocks-with-memoized-debugging-info)
-
-(define (initialize-package!)
-  (set! blocks-with-memoized-debugging-info (make-population))
-  unspecific)
 \f
-(define (compiled-entry/dbg-object entry)
+(define (compiled-entry/dbg-object entry #!optional demand-load?)
   (let ((block (compiled-entry/block entry))
        (offset (compiled-entry/offset entry)))
-    (let ((dbg-info (compiled-code-block/dbg-info block)))
-      (discriminate-compiled-entry entry
-       (lambda ()
-         (vector-binary-search (dbg-info/procedures dbg-info)
-                               <
-                               dbg-procedure/label-offset
-                               offset))
-       (lambda ()
-         (vector-binary-search (dbg-info/continuations dbg-info)
-                               <
-                               dbg-continuation/label-offset
-                               offset))
-       (lambda ()
-         (let ((expression (dbg-info/expression dbg-info)))
-           (and (= offset (dbg-expression/label-offset expression))
-                expression)))
-       (lambda ()
-         false)))))
+    (let ((dbg-info
+          (compiled-code-block/dbg-info block
+                                        (if (default-object? demand-load?)
+                                            false
+                                            demand-load?))))
+      (and dbg-info
+          (discriminate-compiled-entry entry
+            (lambda ()
+              (vector-binary-search (dbg-info/procedures dbg-info)
+                                    <
+                                    dbg-procedure/label-offset
+                                    offset))
+            (lambda ()
+              (vector-binary-search (dbg-info/continuations dbg-info)
+                                    <
+                                    dbg-continuation/label-offset
+                                    offset))
+            (lambda ()
+              (let ((expression (dbg-info/expression dbg-info)))
+                (and (= offset (dbg-expression/label-offset expression))
+                     expression)))
+            (lambda ()
+              false))))))
 
 (define (compiled-entry/block entry)
   (if (compiled-closure? entry)
@@ -144,15 +157,6 @@ MIT in each case. |#
          (else
           false))))
 
-(define (compiled-procedure/name entry)
-  (and *compiler-info/load-on-demand?*
-       (let ((procedure (compiled-entry/dbg-object entry)))
-        (and procedure
-             (dbg-procedure/name procedure)))))
-
-(define *compiler-info/load-on-demand?*
-  false)
-
 (define (dbg-labels/find-offset labels offset)
   (vector-binary-search labels < dbg-label/offset offset))
 
@@ -277,4 +281,24 @@ MIT in each case. |#
        ((object-type? (ucode-type uninterned-symbol) name)
         (write-to-string name))
        (else
-        (error "Illegal dbg-name" name))))
\ No newline at end of file
+        (error "Illegal dbg-name" name))))
+
+  (let ((procedure
+        (compiled-entry/dbg-object entry *compiler-info/load-on-demand?*)))
+  (let ((procedure (compiled-entry/dbg-object entry)))
+    (and procedure
+        (let ((name (dbg-procedure/name procedure)))
+          (or (special-form-procedure-name? name)
+              name)))))
+(define *compiler-info/load-on-demand?*
+  false)
+
+
+(define (special-form-procedure-name? name)
+  (let ((association
+        (list-search-positive special-form-procedure-names
+          (lambda (association)
+            (dbg-name=? (car association) name)))))
+    (and association
+        (symbol->string (cdr association)))))
+(define special-form-procedure-names)  entry)))
\ No newline at end of file
index 13e765f7de8b908fb0f2ed5150b0fe0a722ca93a..a6004bd17645691afba21696fd3827632689036f 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/runtime/make.scm,v 14.5 1988/10/29 00:12:33 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/runtime/make.scm,v 14.6 1988/12/30 23:30:07 cph Exp $
 
 Copyright (c) 1988 Massachusetts Institute of Technology
 
@@ -140,13 +140,20 @@ MIT in each case. |#
 \f
 ;;;; Utilities
 
-(define (fasload filename)
+(define fasload-saved-values
+  '())
+
+(define (fasload filename save-value?)
   (tty-write-char newline-char)
   (tty-write-string filename)
   (tty-flush-output)
   (let ((value (binary-fasload filename)))
     (tty-write-string " loaded")
     (tty-flush-output)
+    (if save-value?
+       (set! fasload-saved-values
+             (cons (cons filename value)
+                   fasload-saved-values)))
     value))
 
 (define (eval object environment)
@@ -223,7 +230,7 @@ MIT in each case. |#
 \f
 ;; Construct the package structure.
 ;; Lotta hair here to load the package code before its package is built.
-(eval (cold-load/purify (fasload (map-filename "packag")))
+(eval (cold-load/purify (fasload (map-filename "packag") true))
       environment-for-package)
 ((access initialize-package! environment-for-package))
 (let loop ((names
@@ -246,7 +253,7 @@ MIT in each case. |#
                                    (car names))
             (loop (cdr names)))))
 (package/add-child! system-global-package 'PACKAGE environment-for-package)
-(eval (fasload "runtim.bcon") system-global-environment)
+(eval (fasload "runtim.bcon" false) system-global-environment)
 
 ;; Global databases.  Load, then initialize.
 (let loop
@@ -261,7 +268,8 @@ MIT in each case. |#
        ("gc" . (RUNTIME GARBAGE-COLLECTOR)))))
   (if (not (null? files))
       (begin
-       (eval (cold-load/purify (fasload (map-filename (car (car files)))))
+       (eval (cold-load/purify
+              (fasload (map-filename (car (car files))) true))
              (package-reference (cdr (car files))))
        (loop (cdr files)))))
 (package-initialize '(RUNTIME GC-DAEMONS) 'INITIALIZE-PACKAGE!)
@@ -279,7 +287,7 @@ MIT in each case. |#
                    constant-space/base)
 
 ;; Load everything else.
-((eval (fasload "runtim.bldr") system-global-environment)
+((eval (fasload "runtim.bldr" false) system-global-environment)
  (lambda (filename environment)
    (if (not (or (string=? filename "packag")
                (string=? filename "gcdemn")
@@ -290,7 +298,7 @@ MIT in each case. |#
                (string=? filename "boot")
                (string=? filename "queue")
                (string=? filename "gc")))
-       (eval (purify (fasload (map-filename filename))) environment)))
+       (eval (purify (fasload (map-filename filename) true)) environment)))
  `((SORT-TYPE . MERGE-SORT)
    (OS-TYPE . ,(string->symbol (string-upcase os-name-string)))
    (OPTIONS . NO-LOAD)))
@@ -367,6 +375,14 @@ MIT in each case. |#
    ;; Emacs -- last because it grabs the kitchen sink.
    (RUNTIME EMACS-INTERFACE)
    ))
+\f
+(let ((fasload/update-debugging-info!
+       (access fasload/update-debugging-info!
+              (->environment '(RUNTIME COMPILER-INFO)))))
+  (for-each (lambda (entry)
+             (fasload/update-debugging-info! (cdr entry)
+                                             (->pathname (car entry))))
+           fasload-saved-values))
 
 )
 
index 8afcbf5c10fb52c0a42efc43f2bd73db20d89120..1c6bd76a2d0694e9d89d879bc6d84968536dfab4 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/runtime/runtime.pkg,v 14.23 1988/12/30 06:43:14 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/runtime/runtime.pkg,v 14.24 1988/12/30 23:30:13 cph Exp $
 
 Copyright (c) 1988 Massachusetts Institute of Technology
 
@@ -218,9 +218,8 @@ MIT in each case. |#
          compiled-procedure/name
          discard-debugging-info!)
   (export (runtime load)         fasload/update-debugging-info!)
-  (export (runtime debugger-utilities)
-         dbg-name<?
-         dbg-name=?)
+  (export (runtime debugger-command-loop)
+         special-form-procedure-name?)
   (export (runtime environment)
          dbg-block/find-name
          dbg-block/ic-parent-index
@@ -359,7 +358,6 @@ MIT in each case. |#
          show-environment-bindings
          show-frame
          show-frames
-         special-name?
          write-dbg-name)
   (initialization (initialize-package!)))