0.pre7.74:
[sbcl.git] / src / code / debug-info.lisp
index e89294d..52cb5ba 100644 (file)
@@ -31,7 +31,7 @@
 
 ;;; FIXME: old CMU CL representation follows:
 ;;;    Compiled debug variables are in a packed binary representation in the
-;;; DEBUG-FUNCTION-VARIABLES:
+;;; DEBUG-FUN-VARIABLES:
 ;;;    single byte of boolean flags:
 ;;;    uninterned name
 ;;;       packaged name
@@ -60,7 +60,7 @@
 ;;;; compiled debug blocks
 ;;;;
 ;;;;    Compiled debug blocks are in a packed binary representation in the
-;;;; DEBUG-FUNCTION-BLOCKS:
+;;;; DEBUG-FUN-BLOCKS:
 ;;;;    number of successors + bit flags (single byte)
 ;;;;   elsewhere-p
 ;;;;    ...ordinal number of each successor in the function's blocks vector...
   #(:unknown-return :known-return :internal-error :non-local-exit
     :block-start :call-site :single-value-return :non-local-entry))
 \f
-;;;; DEBUG-FUNCTION objects
+;;;; DEBUG-FUN objects
 
-(def!struct (debug-function (:constructor nil)))
+(def!struct (debug-fun (:constructor nil)))
 
-(def!struct (compiled-debug-function (:include debug-function)
-                                    #-sb-xc-host (:pure t))
+(def!struct (compiled-debug-fun (:include debug-fun)
+                               #-sb-xc-host (:pure t))
   ;; The name of this function. If from a DEFUN, etc., then this is the
   ;; function name, otherwise it is a descriptive string.
-  (name (required-argument) :type (or simple-string cons symbol))
+  (name (missing-arg) :type (or simple-string cons symbol))
   ;; The kind of function (same as FUNCTIONAL-KIND):
   (kind nil :type (member nil :optional :external :top-level :cleanup))
   ;; a description of variable locations for this function, in alphabetical
   ;;
   ;; Each entry is:
   ;;   * a FLAGS value, which is a FIXNUM with various
-  ;;     COMPILED-DEBUG-FUNCTION-FOO bits set
+  ;;     COMPILED-DEBUG-FUN-FOO bits set
   ;;   * the symbol which names this variable, unless debug info is minimal
   ;;   * the variable ID, when it has one
   ;;   * SC-offset of primary location, if it has one
   ;;   * SC-offset of save location, if it has one
   (variables nil :type (or simple-vector null))
-  ;; A vector of the packed binary representation of the COMPILED-DEBUG-BLOCKs
-  ;; in this function, in the order that the blocks were emitted. The first
-  ;; block is the start of the function. This slot may be NIL to save space.
+  ;; a vector of the packed binary representation of the
+  ;; COMPILED-DEBUG-BLOCKs in this function, in the order that the
+  ;; blocks were emitted. The first block is the start of the
+  ;; function. This slot may be NIL to save space.
   ;;
   ;; FIXME: The "packed binary representation" description in the comment
   ;; above is the same as the description of the old representation of
   ;;    The following two locations are the more arg context and count.
   ;;
   ;; <any other symbol>
-  ;;    The following location is the value of the keyword argument with the
+  ;;    The following location is the value of the &KEY argument with the
   ;;    specified name.
   ;;
   ;; This may be NIL to save space. If no symbols are present, then this will
   ;;    in order to save space, we elected not to store a vector.
   (returns :fixed :type (or (simple-array * (*)) (member :standard :fixed)))
   ;; SC-Offsets describing where the return PC and return FP are kept.
-  (return-pc (required-argument) :type sc-offset)
-  (old-fp (required-argument) :type sc-offset)
+  (return-pc (missing-arg) :type sc-offset)
+  (old-fp (missing-arg) :type sc-offset)
   ;; SC-Offset for the number stack FP in this function, or NIL if no NFP
   ;; allocated.
   (nfp nil :type (or sc-offset null))
   ;; The earliest PC in this function at which the environment is properly
   ;; initialized (arguments moved from passing locations, etc.)
-  (start-pc (required-argument) :type index)
+  (start-pc (missing-arg) :type index)
   ;; The start of elsewhere code for this function (if any.)
-  (elsewhere-pc (required-argument) :type index))
+  (elsewhere-pc (missing-arg) :type index))
 \f
 ;;;; minimal debug function
 
 ;;; debug-info format can represent any function at level 0, and any fixed-arg
 ;;; function at level 1.
 ;;;
-;;; In the minimal format, the debug functions and function map are packed into
-;;; a single byte-vector which is placed in the
-;;; COMPILED-DEBUG-INFO-FUNCTION-MAP. Because of this, all functions in a
-;;; component must be representable in minimal format for any function to
-;;; actually be dumped in minimal format. The vector is a sequence of records
-;;; in this format:
+;;; In the minimal format, the debug functions and function map are
+;;; packed into a single byte-vector which is placed in the
+;;; COMPILED-DEBUG-INFO-FUN-MAP. Because of this, all functions in a
+;;; component must be representable in minimal format for any function
+;;; to actually be dumped in minimal format. The vector is a sequence
+;;; of records in this format:
 ;;;    name representation + kind + return convention (single byte)
 ;;;    bit flags (single byte)
 ;;;    setf, nfp, variables
 ;;;    from the previous function's elsewhere code start. (i.e. the
 ;;;    encoding is the same as for code-start-pc.)
 
-#|
-### For functions with XEPs, name could be represented more simply and
-compactly as some sort of info about with how to find the function-entry that
-this is a function for. Actually, you really hardly need any info. You can
-just chain through the functions in the component until you find the right one.
-Well, I guess you need to at least know which function is an XEP for the real
-function (which would be useful info anyway).
-|#
-
-;;; The following are definitions of bit-fields in the first byte of
-;;; the minimal debug function:
-(defconstant minimal-debug-function-name-symbol 0)
-(defconstant minimal-debug-function-name-packaged 1)
-(defconstant minimal-debug-function-name-uninterned 2)
-(defconstant minimal-debug-function-name-component 3)
-(defconstant-eqx minimal-debug-function-name-style-byte (byte 2 0) #'equalp)
-(defconstant-eqx minimal-debug-function-kind-byte (byte 3 2) #'equalp)
-(defparameter *minimal-debug-function-kinds*
-  #(nil :optional :external :top-level :cleanup))
-(defconstant minimal-debug-function-returns-standard 0)
-(defconstant minimal-debug-function-returns-specified 1)
-(defconstant minimal-debug-function-returns-fixed 2)
-(defconstant-eqx minimal-debug-function-returns-byte (byte 2 5) #'equalp)
-
-;;; The following are bit-flags in the second byte of the minimal debug
-;;; function:
-;;;   * If true, wrap (SETF ...) around the name.
-(defconstant minimal-debug-function-setf-bit (ash 1 0))
-;;;   * If true, there is a NFP.
-(defconstant minimal-debug-function-nfp-bit (ash 1 1))
-;;;   * If true, variables (hence arguments) have been dumped.
-(defconstant minimal-debug-function-variables-bit (ash 1 2))
+;;; ### For functions with XEPs, name could be represented more simply
+;;; and compactly as some sort of info about with how to find the
+;;; FUNCTION-ENTRY that this is a function for. Actually, you really
+;;; hardly need any info. You can just chain through the functions in
+;;; the component until you find the right one. Well, I guess you need
+;;; to at least know which function is an XEP for the real function
+;;; (which would be useful info anyway).
 \f
 ;;;; debug source
 
 (def!struct (debug-source #-sb-xc-host (:pure t))
   ;; This slot indicates where the definition came from:
-  ;;    :FILE - from a file (COMPILE-FILE)
-  ;;    :LISP - from Lisp (COMPILE)
-  (from (required-argument) :type (member :file :lisp))
+  ;;    :FILE - from a file (i.e. COMPILE-FILE)
+  ;;    :LISP - from Lisp (i.e. COMPILE)
+  (from (missing-arg) :type (member :file :lisp))
   ;; If :FILE, the file name, if :LISP or :STREAM, then a vector of
   ;; the top-level forms. When from COMPILE, form 0 is #'(LAMBDA ...).
   (name nil)
@@ -272,14 +248,15 @@ function (which would be useful info anyway).
   ;; unavailable
   (created nil :type (or unsigned-byte null))
   ;; the universal time that the source was compiled
-  (compiled (required-argument) :type unsigned-byte)
+  (compiled (missing-arg) :type unsigned-byte)
   ;; the source path root number of the first form read from this
   ;; source (i.e. the total number of forms converted previously in
   ;; this compilation)
   (source-root 0 :type index)
   ;; The FILE-POSITIONs of the truly top-level forms read from this
   ;; file (if applicable). The vector element type will be chosen to
-  ;; hold the largest element. May be null to save space.
+  ;; hold the largest element. May be null to save space, or if
+  ;; :DEBUG-SOURCE-FORM is :LISP.
   (start-positions nil :type (or (simple-array * (*)) null))
   ;; If from :LISP, this is the function whose source is form 0.
   (info nil))
@@ -288,7 +265,7 @@ function (which would be useful info anyway).
 
 (def!struct debug-info
   ;; Some string describing something about the code in this component.
-  (name (required-argument) :type simple-string)
+  (name (missing-arg) :type simple-string)
   ;; A list of DEBUG-SOURCE structures describing where the code for this
   ;; component came from, in the order that they were read.
   ;;
@@ -301,7 +278,7 @@ function (which would be useful info anyway).
 (def!struct (compiled-debug-info
             (:include debug-info)
             #-sb-xc-host (:pure t))
-  ;; a simple-vector of alternating DEBUG-FUNCTION objects and fixnum
+  ;; a simple-vector of alternating DEBUG-FUN objects and fixnum
   ;; PCs, used to map PCs to functions, so that we can figure out what
   ;; function we were running in. Each function is valid between the
   ;; PC before it (inclusive) and the PC after it (exclusive). The PCs
@@ -313,4 +290,4 @@ function (which would be useful info anyway).
   ;; always careful to put our code in low memory. Is that how it
   ;; works? Would this break if we used a more general memory map? --
   ;; WHN 20000120
-  (function-map (required-argument) :type simple-vector :read-only t))
+  (fun-map (missing-arg) :type simple-vector :read-only t))