- (sb!di:do-debug-fun-blocks (block debug-fun)
- (let ((first-location-in-block-p t))
- (sb!di:do-debug-block-locations (loc block)
- (let ((pc (sb!di::compiled-code-location-pc loc)))
-
- ;; Put blank lines in at block boundaries
- (when (and first-location-in-block-p
- (/= pc last-block-pc))
- (setf first-location-in-block-p nil)
- (add-hook pc
- (lambda (stream dstate)
- (print-block-boundary stream dstate))
- t)
- (setf last-block-pc pc))
-
- ;; Print out corresponding source; this information is not
- ;; all that accurate, but it's better than nothing
- (unless (zerop (sb!di:code-location-form-number loc))
- (multiple-value-bind (form new)
- (get-different-source-form loc 0 sfcache)
- (when new
- (let ((at-block-begin (= pc last-block-pc)))
- (add-hook
- pc
- (lambda (stream dstate)
- (declare (ignore dstate))
- (when stream
- (unless at-block-begin
- (terpri stream))
- (format stream ";;; [~W] "
- (sb!di:code-location-form-number
- loc))
- (prin1-short form stream)
- (terpri stream)
- (terpri stream)))
- t)))))
-
- ;; Keep track of variable live-ness as best we can.
- (let ((live-set
- (copy-seq (sb!di::compiled-code-location-live-set
- loc))))
- (add-hook
- pc
- (lambda (stream dstate)
- (declare (ignore stream))
- (setf (dstate-current-valid-locations dstate)
- live-set)
- #+nil
- (note (lambda (stream)
- (let ((*print-length* nil))
- (format stream "live set: ~S"
- live-set)))
- dstate))))
- ))))
- (sb!di:no-debug-blocks () nil)))))
+ (sb!di:do-debug-fun-blocks (block debug-fun)
+ (let ((first-location-in-block-p t))
+ (sb!di:do-debug-block-locations (loc block)
+ (let ((pc (sb!di::compiled-code-location-pc loc)))
+
+ ;; Put blank lines in at block boundaries
+ (when (and first-location-in-block-p
+ (/= pc last-block-pc))
+ (setf first-location-in-block-p nil)
+ (add-hook pc
+ (lambda (stream dstate)
+ (print-block-boundary stream dstate))
+ t)
+ (setf last-block-pc pc))
+
+ ;; Print out corresponding source; this information is not
+ ;; all that accurate, but it's better than nothing
+ (unless (zerop (sb!di:code-location-form-number loc))
+ (multiple-value-bind (form new)
+ (get-different-source-form loc 0 sfcache)
+ (when new
+ (let ((at-block-begin (= pc last-block-pc)))
+ (add-hook
+ pc
+ (lambda (stream dstate)
+ (declare (ignore dstate))
+ (when stream
+ (unless at-block-begin
+ (terpri stream))
+ (format stream ";;; [~W] "
+ (sb!di:code-location-form-number
+ loc))
+ (prin1-short form stream)
+ (terpri stream)
+ (terpri stream)))
+ t)))))
+
+ ;; Keep track of variable live-ness as best we can.
+ (let ((live-set
+ (copy-seq (sb!di::compiled-code-location-live-set
+ loc))))
+ (add-hook
+ pc
+ (lambda (stream dstate)
+ (declare (ignore stream))
+ (setf (dstate-current-valid-locations dstate)
+ live-set)
+ #+nil
+ (note (lambda (stream)
+ (let ((*print-length* nil))
+ (format stream "live set: ~S"
+ live-set)))
+ dstate))))
+ ))))
+ (sb!di:no-debug-blocks () nil)))))