From 8b89077f2d8c3aec140ded650d95d7869f6a7f28 Mon Sep 17 00:00:00 2001 From: William Harold Newman Date: Fri, 21 Dec 2001 14:09:59 +0000 Subject: [PATCH] 0.pre7.94: more tweaking/tidying motivated by my feasibility study of making debug names be stored in a single place... ...rewrote DEBUG-INFO-FOR-COMPONENT to make it clear that it's working with LAMBDAs, not functions ...removed now-redundant GET-DEBUG-INFO-FUN-MAP in favor of SB!C::COMPILED-DEBUG-INFO-FUN-MAP --- src/code/debug-int.lisp | 22 +++++----------------- src/compiler/debug-dump.lisp | 29 +++++++++++++++-------------- src/compiler/target-disassem.lisp | 7 +++---- version.lisp-expr | 2 +- 4 files changed, 24 insertions(+), 36 deletions(-) diff --git a/src/code/debug-int.lisp b/src/code/debug-int.lisp index 7d2ba9e..071a476 100644 --- a/src/code/debug-int.lisp +++ b/src/code/debug-int.lisp @@ -986,10 +986,10 @@ ;;;; frame utilities -;;; This returns a COMPILED-DEBUG-FUN for code and pc. We fetch the +;;; This returns a COMPILED-DEBUG-FUN for COMPONENT and PC. We fetch the ;;; SB!C::DEBUG-INFO and run down its FUN-MAP to get a -;;; SB!C::COMPILED-DEBUG-FUN from the pc. The result only needs to -;;; reference the component, for function constants, and the +;;; SB!C::COMPILED-DEBUG-FUN from the PC. The result only needs to +;;; reference the COMPONENT, for function constants, and the ;;; SB!C::COMPILED-DEBUG-FUN. (defun debug-fun-from-pc (component pc) (let ((info (%code-debug-info component))) @@ -999,7 +999,7 @@ ((eq info :bogus-lra) (make-bogus-debug-fun "function end breakpoint")) (t - (let* ((fun-map (get-debug-info-fun-map info)) + (let* ((fun-map (sb!c::compiled-debug-info-fun-map info)) (len (length fun-map))) (declare (type simple-vector fun-map)) (if (= len 1) @@ -1188,7 +1188,7 @@ (and (sb!c::compiled-debug-fun-p x) (eq (sb!c::compiled-debug-fun-name x) name) (eq (sb!c::compiled-debug-fun-kind x) nil))) - (get-debug-info-fun-map + (sb!c::compiled-debug-info-fun-map (%code-debug-info component))))) (if res (make-compiled-debug-fun res component) @@ -1628,18 +1628,6 @@ save-sc-offset) buffer))))))) -;;;; unpacking minimal debug functions - -;;; Return a FUN-MAP for a given COMPILED-DEBUG-INFO object. -(defun get-debug-info-fun-map (info) - (declare (type sb!c::compiled-debug-info info)) - (let ((map (sb!c::compiled-debug-info-fun-map info))) - ;; The old CMU CL had various hairy possibilities here, but in - ;; SBCL we only use this one, right? - (aver (simple-vector-p map)) - ;; So it's easy.. - map)) - ;;;; CODE-LOCATIONs ;;; If we're sure of whether code-location is known, return T or NIL. diff --git a/src/compiler/debug-dump.lisp b/src/compiler/debug-dump.lisp index b12a743..fdfdd67 100644 --- a/src/compiler/debug-dump.lisp +++ b/src/compiler/debug-dump.lisp @@ -545,20 +545,21 @@ ;;; called after assembly so that source map information is available. (defun debug-info-for-component (component) (declare (type component component)) - (collect ((dfuns)) - (let ((var-locs (make-hash-table :test 'eq)) - (*byte-buffer* (make-array 10 - :element-type '(unsigned-byte 8) - :fill-pointer 0 - :adjustable t))) - (dolist (fun (component-lambdas component)) - (clrhash var-locs) - (dfuns (cons (label-position (block-label (lambda-block fun))) - (compute-1-debug-fun fun var-locs)))) - (let* ((sorted (sort (dfuns) #'< :key #'car)) - (fun-map (compute-debug-fun-map sorted))) - (make-compiled-debug-info :name (component-name component) - :fun-map fun-map))))) + (let ((dfuns nil) + (var-locs (make-hash-table :test 'eq)) + (*byte-buffer* (make-array 10 + :element-type '(unsigned-byte 8) + :fill-pointer 0 + :adjustable t))) + (dolist (lambda (component-lambdas component)) + (clrhash var-locs) + (push (cons (label-position (block-label (lambda-block lambda))) + (compute-1-debug-fun lambda var-locs)) + dfuns)) + (let* ((sorted (sort dfuns #'< :key #'car)) + (fun-map (compute-debug-fun-map sorted))) + (make-compiled-debug-info :name (component-name component) + :fun-map fun-map)))) ;;; Write BITS out to BYTE-BUFFER in backend byte order. The length of ;;; BITS must be evenly divisible by eight. diff --git a/src/compiler/target-disassem.lisp b/src/compiler/target-disassem.lisp index 600442e..0b81dd9 100644 --- a/src/compiler/target-disassem.lisp +++ b/src/compiler/target-disassem.lisp @@ -1075,11 +1075,11 @@ (values nil nil) (values (get-source-form loc context cache) t))) -;;;; stuff to use debugging-info to augment the disassembly +;;;; stuff to use debugging info to augment the disassembly (defun code-fun-map (code) (declare (type sb!kernel:code-component code)) - (sb!di::get-debug-info-fun-map (sb!kernel:%code-debug-info code))) + (sb!c::compiled-debug-info-fun-map (sb!kernel:%code-debug-info code))) (defstruct (location-group (:copier nil)) (locations #() :type (vector (or list fixnum)))) @@ -1364,8 +1364,7 @@ (when first-block-seen-p (setf nil-block-seen-p t)))) (setf last-debug-fun - (sb!di::make-compiled-debug-fun fmap-entry code)) - ))))) + (sb!di::make-compiled-debug-fun fmap-entry code))))))) (let ((max-offset (code-inst-area-length code))) (when (and first-block-seen-p last-debug-fun) (add-seg last-offset diff --git a/version.lisp-expr b/version.lisp-expr index 9eee371..6b51bf2 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -18,4 +18,4 @@ ;;; for internal versions, especially for internal versions off the ;;; main CVS branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.pre7.93" +"0.pre7.94" -- 1.7.10.4