0.7.13.21:
[sbcl.git] / src / code / debug-info.lisp
index d71f547..9b58481 100644 (file)
@@ -31,7 +31,7 @@
 
 ;;; FIXME: old CMU CL representation follows:
 ;;;    Compiled debug variables are in a packed binary representation in the
-;;; DEBUG-FUN-VARIABLES:
+;;; DEBUG-FUN-VARS:
 ;;;    single byte of boolean flags:
 ;;;    uninterned name
 ;;;       packaged name
 ;;;     ...package name bytes...]
 ;;;    [If has ID, ID as var-length integer]
 ;;;    SC-Offset of primary location (as var-length integer)
-;;;    [If has save SC, SC-Offset of save location (as var-length integer)]
+;;;    [If has save SC, SC-OFFSET of save location (as var-length integer)]
 
 ;;; FIXME: The first two are no longer used in SBCL.
 ;;;(defconstant compiled-debug-var-uninterned          #b00000001)
 ;;;(defconstant compiled-debug-var-packaged            #b00000010)
-(defconstant compiled-debug-var-environment-live       #b00000100)
-(defconstant compiled-debug-var-save-loc-p             #b00001000)
-(defconstant compiled-debug-var-id-p                   #b00010000)
-(defconstant compiled-debug-var-minimal-p              #b00100000)
-(defconstant compiled-debug-var-deleted-p              #b01000000)
+(def!constant compiled-debug-var-environment-live      #b00000100)
+(def!constant compiled-debug-var-save-loc-p            #b00001000)
+(def!constant compiled-debug-var-id-p                  #b00010000)
+(def!constant compiled-debug-var-minimal-p             #b00100000)
+(def!constant compiled-debug-var-deleted-p             #b01000000)
 \f
 ;;;; compiled debug blocks
 ;;;;
@@ -74,7 +74,7 @@
 ;;;;       tuples...
 
 (defconstant-eqx compiled-debug-block-nsucc-byte (byte 2 0) #'equalp)
-(defconstant compiled-debug-block-elsewhere-p #b00000100)
+(def!constant compiled-debug-block-elsewhere-p #b00000100)
 
 (defconstant-eqx compiled-code-location-kind-byte (byte 3 0) #'equalp)
 (defparameter *compiled-code-location-kinds*
 
 (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.
+  ;; KLUDGE: Courtesy of more than a decade of, ah, organic growth in
+  ;; CMU CL, there are two distinct -- but coupled -- mechanisms to
+  ;; finding the name of a function. The slot here is one mechanism
+  ;; (used in CMU CL to look up names in the debugger, e.g. in
+  ;; BACKTRACE). The other mechanism is the the NAME slot in function
+  ;; primitive objects (used in CMU CL to look up names elsewhere,
+  ;; e.g. in CL:FUNCTION-LAMBDA-EXPRESSION and in CL:DESCRIBE).
+  ;;
+  ;; They're coupled by the way that DEBUG-FUN objects are looked up.
+  ;; A list of DEBUG-FUN objects is maintained for each COMPONENT. To
+  ;; figure out which DEBUG-FUN object corresponds to your FUNCTION
+  ;; object, you compare the name values of each. -- WHN 2001-12-20
   (name (missing-arg) :type (or simple-string cons symbol))
   ;; The kind of function (same as FUNCTIONAL-KIND):
   (kind nil :type (member nil :optional :external :toplevel :cleanup))
   ;;   * 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))
+  (vars 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.
   ;;
-  ;; FIXME: The "packed binary representation" description in the comment
-  ;; above is the same as the description of the old representation of
-  ;; VARIABLES which doesn't work properly in SBCL (because it doesn't
-  ;; transform correctly under package renaming). Check whether this slot's
-  ;; data might have the same problem that that slot's data did.
+  ;; FIXME: The "packed binary representation" description in the
+  ;; comment above is the same as the description of the old
+  ;; representation of VARIABLES which doesn't work properly in SBCL
+  ;; (because it doesn't transform correctly under package renaming).
+  ;; Check whether this slot's data might have the same problem that
+  ;; that slot's data did.
   (blocks nil :type (or (simple-array (unsigned-byte 8) (*)) null))
   ;; If all code locations in this function are in the same top level
   ;; form, then this is the number of that form, otherwise NIL. If
   ;;    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
-  ;; be represented with an I-vector with sufficiently large element type. If
-  ;; this is :MINIMAL, then this means that the VARIABLES are all required
-  ;; arguments, and are in the order they appear in the VARIABLES vector. In
-  ;; other words, :MINIMAL stands in for a vector where every element holds its
-  ;; index.
+  ;; This may be NIL to save space. If no symbols are present, then
+  ;; this will be represented with an I-vector with sufficiently large
+  ;; element type. If this is :MINIMAL, then this means that the
+  ;; VARIABLES are all required arguments, and are in the order they
+  ;; appear in the VARIABLES vector. In other words, :MINIMAL stands
+  ;; in for a vector where every element holds its index.
   (arguments nil :type (or (simple-array * (*)) (member :minimal nil)))
   ;; There are three alternatives for this slot:
   ;;
-  ;; A vector
+  ;; a VECTOR
   ;;    A vector of SC-OFFSETS describing the return locations. The
   ;;    vector element type is chosen to hold the largest element.
   ;;
-  ;; :Standard
+  ;; :STANDARD
   ;;    The function returns using the standard unknown-values convention.
   ;;
-  ;; :Fixed
+  ;; :FIXED
   ;;    The function returns using the fixed-values convention, but
   ;;    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.
+  ;; SC-OFFSETs describing where the return PC and return FP are kept.
   (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.
+  ;; 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.)
 
 ;;; ### 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
+;;; 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
 (def!struct (compiled-debug-info
             (:include debug-info)
             #-sb-xc-host (:pure t))
-  ;; a simple-vector of alternating DEBUG-FUN 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