Changeset 12949
- Timestamp:
- Oct 9, 2009, 11:01:30 AM (15 years ago)
- Location:
- branches/working-0711/ccl
- Files:
-
- 4 edited
-
compiler/X86/x86-disassemble.lisp (modified) (8 diffs)
-
compiler/X86/x862.lisp (modified) (2 diffs)
-
lib/describe.lisp (modified) (31 diffs)
-
lib/misc.lisp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/working-0711/ccl/compiler/X86/x86-disassemble.lisp
r12339 r12949 2671 2671 2672 2672 2673 2673 (defmethod x86-lap-operand-constant-offset (op ds) 2674 (declare (ignore op ds)) 2675 nil) 2676 2677 (defmethod x86-lap-operand-constant-offset ((op x86::x86-memory-operand) ds) 2678 (let* ((disp (x86::x86-memory-operand-disp op)) 2679 (base (x86::x86-memory-operand-base op)) 2680 (index (x86::x86-memory-operand-index op)) 2681 (scale (x86::x86-memory-operand-scale op)) 2682 (code-limit (x86-ds-code-limit ds)) 2683 (val (and base 2684 (eq (x86::x86-register-operand-entry base) 2685 (if (x86-ds-mode-64 ds) 2686 (x86::x86-reg64 13) 2687 (x86::x86-reg32 x8632::fn))) 2688 (null index) 2689 (or (eql scale 0) (null scale)) 2690 (typecase disp 2691 (constant-x86-lap-expression 2692 (+ (x86-ds-entry-point ds) 2693 (constant-x86-lap-expression-value disp))) 2694 (integer 2695 (+ (x86-ds-entry-point ds) disp)) 2696 (t nil))))) 2697 (when (and val (>= val code-limit)) 2698 (- val code-limit)))) 2699 2700 (defun x86-lap-operand-constant (op ds) 2701 (let ((diff (x86-lap-operand-constant-offset op ds))) 2702 (when diff 2703 (values (uvref (x86-ds-constants-vector ds) 2704 (1+ (ash diff (if (x86-ds-mode-64 ds) 2705 (- x8664::word-shift) 2706 (- x8632::word-shift))))) 2707 t)))) 2708 2709 2674 2710 (defmethod unparse-x86-lap-operand ((x x86::x86-memory-operand) ds) 2675 (let* ((seg (x86::x86-memory-operand-seg x)) 2676 (disp (x86::x86-memory-operand-disp x)) 2677 (base (x86::x86-memory-operand-base x)) 2678 (index (x86::x86-memory-operand-index x)) 2679 (scale (x86::x86-memory-operand-scale x)) 2680 (val nil)) 2681 (if (and base 2682 (eq (x86::x86-register-operand-entry base) 2683 (if (x86-ds-mode-64 ds) 2684 (x86::x86-reg64 13) 2685 (x86::x86-reg32 x8632::fn))) 2686 (null index) 2687 (or (eql scale 0) (null scale)) 2688 (and (if (typep disp 'constant-x86-lap-expression) 2689 (+ (x86-ds-entry-point ds) 2690 (constant-x86-lap-expression-value disp)) 2691 (unless (typep disp 'x86-lap-expression) 2692 (setq val (if disp 2693 (+ (x86-ds-entry-point ds) 2694 disp))))) 2695 (>= val (x86-ds-code-limit ds)))) 2696 (let* ((diff (- val (x86-ds-code-limit ds))) 2697 (constant (uvref (x86-ds-constants-vector ds) 2698 (1+ (ash diff (if (x86-ds-mode-64 ds) 2699 (- x8664::word-shift) 2700 (- x8632::word-shift))))))) 2701 `(@ ',constant ,(unparse-x86-lap-operand base ds))) 2702 (collect ((subforms)) 2703 (subforms '@) 2704 (if seg 2705 (subforms (unparse-x86-lap-operand seg ds))) 2706 (if disp 2707 (subforms (unparse-x86-lap-expression disp ds))) 2708 (if base 2709 (subforms (unparse-x86-lap-operand base ds))) 2710 (if index 2711 (subforms (unparse-x86-lap-operand index ds))) 2712 (if (and scale (not (eql scale 0))) 2713 (subforms (ash 1 scale))) 2714 (subforms))))) 2711 (multiple-value-bind (constant foundp) (x86-lap-operand-constant x ds) 2712 (if foundp 2713 `(@ ',constant ,(unparse-x86-lap-operand (x86::x86-memory-operand-base x) ds)) 2714 (let* ((seg (x86::x86-memory-operand-seg x)) 2715 (disp (x86::x86-memory-operand-disp x)) 2716 (base (x86::x86-memory-operand-base x)) 2717 (index (x86::x86-memory-operand-index x)) 2718 (scale (x86::x86-memory-operand-scale x))) 2719 (collect ((subforms)) 2720 (subforms '@) 2721 (if seg 2722 (subforms (unparse-x86-lap-operand seg ds))) 2723 (if disp 2724 (subforms (unparse-x86-lap-expression disp ds))) 2725 (if base 2726 (subforms (unparse-x86-lap-operand base ds))) 2727 (if index 2728 (subforms (unparse-x86-lap-operand index ds))) 2729 (if (and scale (not (eql scale 0))) 2730 (subforms (ash 1 scale))) 2731 (subforms)))))) 2715 2732 2716 2733 (defmethod unparse-x86-lap-operand :around ((op x86::x86-operand) … … 2722 2739 `(* ,usual) 2723 2740 usual))) 2741 2742 (defun write-x86-lap-operand (stream op ds) 2743 ;; Basically, have to princ because some parts are already stringified, 2744 ;; plus don't want package prefixes on assembler syntax. But want to 2745 ;; prin1 immediates. 2746 (let ((expr (unparse-x86-lap-operand op ds))) 2747 (format stream " ") 2748 (labels ((out (stream expr) 2749 (cond ((atom expr) 2750 (format stream "~a" expr)) 2751 ((quoted-form-p expr) 2752 (format stream "'~s" (cadr expr))) 2753 (t 2754 (loop for item in expr as pre = "(" then " " 2755 do (format stream pre) 2756 do (out stream item)) 2757 (format stream ")"))))) 2758 (out stream expr)))) 2724 2759 2725 2760 (defvar *previous-source-note*) … … 2749 2784 (op2 (x86-di-op2 instruction))) 2750 2785 (when op0 2751 ( format t " ~a" (unparse-x86-lap-operand op0 ds))2786 (write-x86-lap-operand t op0 ds) 2752 2787 (when op1 2753 (format t " ~a" (unparse-x86-lap-operand op1 ds))2788 (write-x86-lap-operand t op1 ds) 2754 2789 (when op2 2755 ( format t " ~a" (unparse-x86-lap-operand op2 ds))))))2790 (write-x86-lap-operand t op2 ds))))) 2756 2791 (format t ")") 2757 2792 (format t "~%") … … 2769 2804 (ensure-source-note-text source-note)))) 2770 2805 2771 (defun x8664-disassemble-xfunction (function xfunction 2772 &key (symbolic-names x8664::*x8664-symbolic-register-names*) 2773 (collect-function #'x86-print-disassembled-instruction) 2774 (header-function #'x86-print-disassembled-function-header)) 2806 (defun x86-disassemble-xfunction (function xfunction 2807 &key (symbolic-names #+x8664-target target::*x8664-symbolic-register-names* 2808 #+x8632-target target::*x8632-symbolic-register-names*) 2809 (collect-function #'x86-print-disassembled-instruction) 2810 (header-function #'x86-print-disassembled-function-header)) 2775 2811 (check-type xfunction xfunction) 2776 2812 (check-type (uvref xfunction 0) (simple-array (unsigned-byte 8) (*))) 2777 (let* ((ds (make-x86-disassembly-state 2813 (let* ((entry-point #+x8664-target 7 #+x8632-target 2) 2814 (ds (make-x86-disassembly-state 2815 :mode-64 #+x8664-target t #+x8632-target nil 2778 2816 :code-vector (uvref xfunction 0) 2779 2817 :constants-vector xfunction 2780 :entry-point 72781 :code-pointer 0 ; for next-u32 below2818 :entry-point entry-point 2819 :code-pointer 0 ; for next-u32/next-u16 below 2782 2820 :symbolic-names symbolic-names 2783 :pending-labels (list 7)))2821 :pending-labels (list entry-point))) 2784 2822 (blocks (x86-ds-blocks ds))) 2785 2823 (setf (x86-ds-code-limit ds) 2786 (ash (x86-ds-next-u32 ds) 3)) 2824 #+x8664-target (ash (x86-ds-next-u32 ds) 3) 2825 #+x8632-target (ash (x86-ds-next-u16 ds) 2)) 2787 2826 (do* () 2788 2827 ((null (x86-ds-pending-labels ds))) … … 2790 2829 (or (x86-dis-find-label lab blocks) 2791 2830 (x86-disassemble-new-block ds lab)))) 2792 (when (and blocks (let ((something-to-disassemble nil)) 2793 (do-dll-nodes (block blocks) 2794 (do-dll-nodes (instruction (x86-dis-block-instructions block)) 2795 (setf something-to-disassemble t))) 2796 something-to-disassemble)) 2831 (when (and header-function 2832 blocks 2833 (let ((something-to-disassemble nil)) 2834 (do-dll-nodes (block blocks) 2835 (do-dll-nodes (instruction (x86-dis-block-instructions block)) 2836 (setf something-to-disassemble t))) 2837 something-to-disassemble)) 2797 2838 (funcall header-function function xfunction)) 2798 2839 (let* ((seq 0) … … 2803 2844 (setq seq (funcall collect-function ds instruction seq function))))))) 2804 2845 2805 (defun x8632-disassemble-xfunction (function xfunction 2806 &key (symbolic-names x8632::*x8632-symbolic-register-names*) 2807 (collect-function #'x86-print-disassembled-instruction) 2808 (header-function #'x86-print-disassembled-function-header)) 2809 (check-type xfunction xfunction) 2810 (check-type (uvref xfunction 0) (simple-array (unsigned-byte 8) (*))) 2811 (let* ((ds (make-x86-disassembly-state 2812 :mode-64 nil 2813 :code-vector (uvref xfunction 0) 2814 :constants-vector xfunction 2815 :entry-point 2 2816 :code-pointer 0 ; for next-u16 below 2817 :symbolic-names symbolic-names 2818 :pending-labels (list 2))) 2819 (blocks (x86-ds-blocks ds))) 2820 (setf (x86-ds-code-limit ds) (ash (x86-ds-next-u16 ds) 2)) 2821 (do* () 2822 ((null (x86-ds-pending-labels ds))) 2823 (let* ((lab (pop (x86-ds-pending-labels ds)))) 2824 (or (x86-dis-find-label lab blocks) 2825 (x86-disassemble-new-block ds lab)))) 2826 (when (and blocks (let ((something-to-disassemble nil)) 2827 (do-dll-nodes (block blocks) 2828 (do-dll-nodes (instruction (x86-dis-block-instructions block)) 2829 (setf something-to-disassemble t))) 2830 something-to-disassemble)) 2831 (funcall header-function function xfunction)) 2832 (let* ((seq 0) 2833 (*previous-source-note* nil)) 2834 (declare (special *previous-source-note*)) 2835 (do-dll-nodes (block blocks) 2836 (do-dll-nodes (instruction (x86-dis-block-instructions block)) 2837 (setq seq (funcall collect-function ds instruction seq function))))))) 2838 2839 #+x8664-target 2840 (defun x8664-xdisassemble (function 2841 &optional (collect-function #'x86-print-disassembled-instruction) 2842 (header-function #'x86-print-disassembled-function-header)) 2843 (let* ((fv (%function-to-function-vector function)) 2846 (defun x86-xdisassemble (function 2847 &optional (collect-function #'x86-print-disassembled-instruction) 2848 (header-function #'x86-print-disassembled-function-header)) 2849 (let* ((fv (function-to-function-vector function)) 2844 2850 (function-size-in-words (uvsize fv)) 2845 2851 (code-words (%function-code-words function)) 2846 (ncode-bytes (ash function-size-in-words x8664::word-shift))2852 (ncode-bytes (ash function-size-in-words target::word-shift)) 2847 2853 (code-bytes (make-array ncode-bytes 2848 2854 :element-type '(unsigned-byte 8))) … … 2855 2861 (j 1 (1+ j))) 2856 2862 ((= k function-size-in-words) 2857 (x86 64-disassemble-xfunction function xfunction2858 :collect-function collect-function2859 :header-function header-function))2863 (x86-disassemble-xfunction function xfunction 2864 :collect-function collect-function 2865 :header-function header-function)) 2860 2866 (declare (fixnum j k)) 2861 2867 (setf (uvref xfunction j) (uvref fv k))))) 2862 2868 2863 #+x8632-target2864 (defun x8632-xdisassemble (function2865 &optional (collect-function #'x86-print-disassembled-instruction)2866 (header-function #'x86-print-disassembled-function-header))2867 (let* ((fv (function-to-function-vector function))2868 (function-size-in-words (uvsize fv))2869 (code-words (%function-code-words function))2870 (ncode-bytes (ash function-size-in-words x8632::word-shift))2871 (code-bytes (make-array ncode-bytes2872 :element-type '(unsigned-byte 8)))2873 (numimms (- function-size-in-words code-words))2874 (xfunction (%alloc-misc (the fixnum (1+ numimms)) target::subtag-xfunction)))2875 (declare (fixnum code-words ncode-bytes numimms))2876 (%copy-ivector-to-ivector fv 0 code-bytes 0 ncode-bytes)2877 (setf (uvref xfunction 0) code-bytes)2878 (do* ((k code-words (1+ k))2879 (j 1 (1+ j)))2880 ((= k function-size-in-words)2881 (x8632-disassemble-xfunction function xfunction2882 :collect-function collect-function2883 :header-function header-function))2884 (declare (fixnum j k))2885 (setf (uvref xfunction j) (uvref fv k)))))2886 2887 2869 (defun disassemble-list (function) 2888 2870 (collect ((instructions)) 2889 ( #+x8632-target x8632-xdisassemble #+x8664-target x8664-xdisassemble2871 (x86-xdisassemble 2890 2872 function 2891 2873 #'(lambda (ds instruction seq function) … … 2913 2895 (insn (unparse-x86-lap-operand op2 ds)) )))) 2914 2896 (instructions (insn)) 2915 (1+ seq))))) 2897 (1+ seq)))) 2898 nil) 2916 2899 (instructions))) 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2900 2901 (defun x86-disassembled-instruction-line (ds instruction function &optional string-stream) 2902 (if (null string-stream) 2903 (with-output-to-string (stream) 2904 (return-from x86-disassembled-instruction-line 2905 (x86-disassembled-instruction-line ds instruction function stream))) 2906 (let* ((addr (x86-di-address instruction)) 2907 (entry (x86-ds-entry-point ds)) 2908 (pc (- addr entry)) 2909 (op0 (x86-di-op0 instruction)) 2910 (op1 (x86-di-op1 instruction)) 2911 (op2 (x86-di-op2 instruction)) 2912 (label (if (x86-di-labeled instruction) (list :label pc) pc)) 2913 (instr (progn 2914 (dolist (p (x86-di-prefixes instruction)) 2915 (format string-stream "(~a) " p)) 2916 (format string-stream "(~a" (x86-di-mnemonic instruction)) 2917 (when op0 (write-x86-lap-operand string-stream op0 ds)) 2918 (when op1 (write-x86-lap-operand string-stream op1 ds)) 2919 (when op2 (write-x86-lap-operand string-stream op2 ds)) 2920 (format string-stream ")") 2921 (get-output-stream-string string-stream))) 2922 (comment (let ((source-note (find-source-note-at-pc function pc))) 2923 (unless (eql (source-note-file-range source-note) 2924 (source-note-file-range *previous-source-note*)) 2925 (setf *previous-source-note* source-note) 2926 (let* ((source-text (source-note-text source-note)) 2927 (text (if source-text 2928 (string-sans-most-whitespace source-text 100) 2929 "#<no source text>"))) 2930 (format string-stream ";;; ~A" text) 2931 (get-output-stream-string string-stream))))) 2932 (imms (let ((imms nil)) 2933 (multiple-value-bind (imm foundp) (x86-lap-operand-constant op2 ds) 2934 (when foundp (push imm imms))) 2935 (multiple-value-bind (imm foundp) (x86-lap-operand-constant op1 ds) 2936 (when foundp (push imm imms))) 2937 (multiple-value-bind (imm foundp) (x86-lap-operand-constant op0 ds) 2938 (when foundp (push imm imms))) 2939 imms))) 2940 ;; Subtle difference between no imms and a single NIL imm, so if anybody ever 2941 ;; cares for some reason, they could distinguish the two cases. 2942 (if imms 2943 (values comment label instr (if (cdr imms) (coerce imms 'vector) (car imms))) 2944 (values comment label instr))))) 2945 2946 (defun disassemble-lines (function) 2947 (let ((source-note (function-source-note function))) 2948 (when source-note 2949 ;; Fetch source from file if don't already have it. 2950 (ensure-source-note-text source-note))) 2951 (let ((lines (make-array 20 :adjustable t :fill-pointer 0))) 2952 (with-output-to-string (stream) 2953 (x86-xdisassemble 2954 function 2955 #'(lambda (ds instruction seq function) 2956 (declare (ignore seq)) 2957 (multiple-value-bind (comment label instr object) 2958 (x86-disassembled-instruction-line ds instruction function stream) 2959 (when comment 2960 (vector-push-extend comment lines)) 2961 (vector-push-extend (list object label instr) lines))) 2962 nil)) 2963 (coerce lines 'simple-vector))) -
branches/working-0711/ccl/compiler/X86/x862.lisp
r12694 r12949 10131 10131 (when disassemble 10132 10132 (format t "~%~%") 10133 (apply #'x86 64-disassemble-xfunction10133 (apply #'x86-disassemble-xfunction 10134 10134 xlfun 10135 10135 (unless symbolic-names (list nil)))) … … 10153 10153 (let ((*target-backend* backend)) 10154 10154 (format t "~%~%") 10155 (apply #'x86 32-disassemble-xfunction10155 (apply #'x86-disassemble-xfunction 10156 10156 xlfun 10157 10157 (unless symbolic-names (list nil))))) -
branches/working-0711/ccl/lib/describe.lisp
r12408 r12949 20 20 "COMPUTE-LINE-COUNT" 21 21 "LINE-N" 22 "INSPECTOR-OBJECT" 23 "INSPECTOR-LINE-COUNT" 22 24 23 25 "*INSPECTOR-DISASSEMBLY*")) … … 35 37 (defclass inspector () 36 38 ((object :accessor inspector-object :initarg :object) 37 (line-count :accessor inspector-line-count :initarg :line-count :initform nil))) 39 (line-count :accessor inspector-line-count :initarg :line-count :initform nil) 40 ;; so can refresh. 41 (initargs :reader inspector-initargs :initform nil))) 42 43 (defmethod initialize-instance :before ((i inspector) &rest initargs) 44 (setf (slot-value i 'initargs) initargs)) 38 45 39 46 ;;; The usual way to cons up an inspector … … 45 52 (when update-line-count 46 53 (update-line-count i))) 54 55 (defmethod refresh-inspector ((i inspector)) 56 (apply #'make-instance (class-of i) (slot-value i 'initargs))) 57 58 ;; New protocol, used by gui inspector instead of the line-n protocol, which isn't quite right. 59 ;; Perhaps tty inspector should use it as well. Returns the line inspector rather than object, 60 ;; and returns the value string rather than having the caller print it. 61 (defmethod inspector-line ((i inspector) index) 62 (let ((line-i (multiple-value-bind (value label type) (inspector::line-n i index) 63 (and (not (eq (parse-type i type) :comment)) 64 (line-n-inspector i index value label type))))) 65 (multiple-value-bind (label-string value-string) (line-n-strings i index) 66 (values line-i label-string value-string)))) 67 68 ;; for a comment value = nil, label = "the comment" type = :comment 69 ;;; => line-i = nil 47 70 48 71 ;;;;;;; … … 89 112 (multiple-value-call #'prin1-line i stream (line-n i n))) 90 113 91 (defmethod prin1-line ((i inspector) stream value &optional 92 label type function) 114 (defmethod prin1-line ((i inspector) stream value &optional label type function) 93 115 (unless function 94 116 (setq function (inspector-print-function i type))) 95 117 (funcall function i stream value label type)) 96 118 119 (defvar *collect-labels-if-list* t) 120 121 (defmethod end-of-label ((stream string-output-stream)) 122 (when (listp *collect-labels-if-list*) 123 (push (get-output-stream-string stream) *collect-labels-if-list*))) 124 125 (defmethod line-n-strings ((i inspector) n) 126 (let* ((*collect-labels-if-list* ()) 127 (value-string (with-output-to-string (stream) 128 (prin1-line-n i stream n))) 129 (label-string (pop *collect-labels-if-list*)) 130 (end (or (position-if-not #'whitespacep label-string :from-end t) -1))) 131 (assert (null *collect-labels-if-list*)) 132 (unless (and (>= end 0) (eql (char label-string end) #\:)) (incf end)) 133 (setq label-string (subseq label-string 0 end)) 134 (values label-string value-string))) 135 97 136 (defmethod inspector-print-function ((i inspector) type) 98 (if (consp type) (setq type (car type))) 99 (if (eq type :comment) 100 'prin1-comment 101 'prin1-normal-line)) 102 137 (declare (ignore type)) 138 'prin1-normal-line) 103 139 104 140 ; Print a value to a stream. … … 111 147 (if colon-p (princ ": " stream))) 112 148 (end-of-label stream) ; used by cacheing code 113 (prin1-value i stream value label type))) 149 (unless (eq type-sym :comment) 150 (prin1-value i stream value label type)))) 114 151 115 152 (defun prin1-colon-line (i stream value &optional label type) … … 126 163 (prin1 value stream)) 127 164 128 (defmethod prin1-comment ((i inspector) stream value &optional label type)129 (when label130 (prin1-label i stream value label type)131 (end-of-label stream)))132 133 165 ;;; Call function on the inspector object and its value, label, & type, for 134 166 ;;; each line in the selected range (default to the whole thing). … … 139 171 (start 0) 140 172 end) 173 (when (null (inspector-line-count i)) 174 (update-line-count i)) 141 175 (unless end 142 176 (setq end (inspector-line-count i))) … … 144 178 (let ((index start)) 145 179 (dotimes (c (- end start)) 146 (declare (fixnum c)) 147 (multiple-value-call function i (line-n i index)) 180 (multiple-value-call function i index (inspector-line i index)) 148 181 (incf index))))) 149 182 … … 213 246 (*signal-printing-errors* nil)) 214 247 ,@body)) 248 249 (defun format-line-for-tty (stream label-string value-string) 250 (when (equal label-string "") (setq label-string nil)) 251 (when (equal value-string "") (setq value-string nil)) 252 (format stream "~@[~a~]~@[~a~]~@[~a~]" 253 label-string 254 (and label-string 255 value-string 256 (not (eql #\space (char label-string (1- (length label-string))))) 257 ": ") 258 value-string)) 215 259 216 260 (defun describe (object &optional stream) … … 226 270 (defmethod describe-object (object stream) 227 271 (let ((inspector (make-inspector object))) 228 (when (null (inspector-line-count inspector))229 (update-line-count inspector))230 272 (with-errorfree-printing 231 273 (let* ((*print-pretty* (or *print-pretty* *describe-pretty*)) 232 (temp #'(lambda (i value &rest rest)233 (declare (dynamic-extent rest))234 (apply #'prin1-line i stream value rest)235 (terpri stream))))274 (temp #'(lambda (i index child &optional label-string value-string) 275 (declare (ignore i index child)) 276 (format-line-for-tty stream label-string value-string) 277 (terpri stream)))) 236 278 (declare (dynamic-extent temp)) 237 279 (map-lines inspector temp)))) … … 257 299 (defmethod prin1-line ((i formatting-inspector) stream value 258 300 &optional label type (format-string "~s")) 259 (if (eq :comment (if (consp type) (car type) type)) 260 (prin1-comment i stream value label type) 261 (funcall (if (listp format-string) #'apply #'funcall) 262 #'format-normal-line i stream value label type format-string))) 301 (funcall (if (listp format-string) #'apply #'funcall) 302 #'format-normal-line i stream value label type format-string)) 263 303 264 304 (defmethod format-normal-line ((i inspector) stream value &optional … … 267 307 (if (eq type-sym :colon) (setq colon-p t)) 268 308 (when label 269 (if (stringp label) 270 (write-string label stream) 271 (princ label stream)) 309 (prin1-label i stream value label type) 272 310 (if colon-p (princ ": " stream))) 273 311 (end-of-label stream) ; used by cacheing code 274 (format stream format-string value))) 312 (unless (eq type-sym :comment) 313 (format stream format-string value)))) 275 314 276 315 ;;;;;;; … … 353 392 (2 (values (class-of object) "Class: " :static)) 354 393 (t (call-next-method i (- n 3)))))) 394 395 (defmethod line-n-inspector :around ((i basics-first-mixin) n value label type) 396 (if (< n 3) 397 (make-inspector value) 398 (call-next-method i (- n 3) value label type))) 355 399 356 400 (defmethod (setf line-n) :around (new-value (i basics-first-mixin) n) … … 981 1025 (find-class sym nil))) 982 1026 983 (defmethod inspector-class ((sym symbol)) 'usual- inspector)1027 (defmethod inspector-class ((sym symbol)) 'usual-basics-first-inspector) 984 1028 985 1029 (defmethod compute-line-count ((sym symbol)) 986 (+ 1 ; The symbol 987 (if (symbol-has-bindings-p sym) 1 0) 1030 (+ (if (symbol-has-bindings-p sym) 1 0) 988 1031 1 ; package 989 1032 1 ; symbol-name … … 997 1040 998 1041 (defmethod normalize-line-number ((sym symbol) n) 999 (if (and (>= n 1) (not (symbol-has-bindings-p sym))) (incf n))1000 (if (and (>= n 6) (not (fboundp sym))) (incf n))1042 (if (and (>= n 0) (not (symbol-has-bindings-p sym))) (incf n)) 1043 (if (and (>= n 5) (not (fboundp sym))) (incf n)) 1001 1044 n) 1002 1045 … … 1007 1050 (static :static)) 1008 1051 (ecase n 1009 (0 (values sym "Symbol: " type)) 1010 (1 (values nil (symbol-type-line sym) comment)) 1011 (2 (let ((p (symbol-package sym))) 1052 (0 (values nil (symbol-type-line sym) comment)) 1053 (1 (let ((p (symbol-package sym))) 1012 1054 (if (null p) 1013 1055 (values nil "No home package." comment) … … 1018 1060 (format nil "~a in package: " kind)) 1019 1061 static))))) 1020 ( 3(values (symbol-name sym) "Print name: " static))1021 ( 4(values (if (boundp sym) (symbol-value sym) *unbound-marker*)1062 (2 (values (symbol-name sym) "Print name: " static)) 1063 (3 (values (if (boundp sym) (symbol-value sym) *unbound-marker*) 1022 1064 "Value: " type)) 1023 ( 5(values (if (fboundp sym)1065 (4 (values (if (fboundp sym) 1024 1066 (cond ((macro-function sym)) 1025 1067 ((special-operator-p sym) sym) … … 1027 1069 *unbound-marker*) 1028 1070 "Function: " type)) 1029 ( 6(values (and (fboundp sym) (arglist sym))1071 (5 (values (and (fboundp sym) (arglist sym)) 1030 1072 "Arglist: " static)) 1031 ( 7(values (symbol-plist sym) "Plist: " type))1032 ( 8(values (find-class sym) "Class: " static)))))1073 (6 (values (symbol-plist sym) "Plist: " type)) 1074 (7 (values (find-class sym) "Class: " static))))) 1033 1075 1034 1076 (defmethod (setf line-n) (value (sym symbol) n) … … 1037 1079 (setq value (restore-unbound value)) 1038 1080 (ecase n 1039 (0 (replace-object *inspector* value)) 1040 ((1 2 3 6) (setf-line-n-out-of-range sym n)) 1041 (4 (setf resample-p (not (boundp sym)) 1081 ((0 1 2 5) (setf-line-n-out-of-range sym n)) 1082 (3 (setf resample-p (not (boundp sym)) 1042 1083 (symbol-value sym) value)) 1043 ( 5(setf resample-p (not (fboundp sym))1084 (4 (setf resample-p (not (fboundp sym)) 1044 1085 (symbol-function sym) value)) 1045 ( 7(setf (symbol-plist sym) value)))1086 (6 (setf (symbol-plist sym) value))) 1046 1087 (when resample-p (resample-it)) 1047 1088 value)) … … 1105 1146 (declare (ignore label type)) 1106 1147 (setq n (normalize-line-number sym n)) 1107 (if (eql n 7)1148 (if (eql n 6) 1108 1149 (make-instance 'plist-inspector :symbol sym :object value) 1109 1150 (call-next-method))) … … 1143 1184 ;; 1144 1185 (defclass function-inspector (inspector) 1145 ((disasm-p :accessor disasm-p :initform *inspector-disassembly*) 1186 ((header-lines :initform nil :reader header-lines) 1187 (disasm-p :accessor disasm-p :initform *inspector-disassembly*) 1146 1188 (disasm-info :accessor disasm-info) 1147 1189 (pc-width :accessor pc-width) 1148 1190 (pc :initarg :pc :initform nil :accessor pc))) 1149 1191 1192 (defmethod standard-header-count ((f function-inspector)) (length (header-lines f))) 1193 1194 (defmethod header-count ((f function-inspector)) (standard-header-count f)) 1195 1150 1196 (defclass closure-inspector (function-inspector) 1151 1197 ((n-closed :accessor closure-n-closed))) 1152 1198 1153 1154 1155 1199 (defmethod inspector-class ((f function)) 'function-inspector) 1156 1200 (defmethod inspector-class ((f compiled-lexical-closure)) 'closure-inspector) 1157 1201 1202 (defmethod compute-line-count :before ((f function-inspector)) 1203 (let* ((o (inspector-object f)) 1204 (doc (documentation o t)) 1205 (sn (ccl::function-source-note o)) 1206 (lines (nconc (list (list o "")) 1207 (list (list (function-name o) "Name" :colon)) 1208 (list (multiple-value-bind (arglist type) (arglist o) 1209 (let ((label (if type 1210 (format nil "Arglist (~(~a~))" type) 1211 "Arglist unknown"))) 1212 (list arglist label (if type :colon '(:comment (:plain))))))) 1213 (when doc (list (list (substitute #\space #\newline doc) "Documentation" :colon))) 1214 (when sn (list (list sn "Source Location" :colon)))))) 1215 (setf (slot-value f 'header-lines) lines))) 1216 1158 1217 (defmethod compute-line-count ((f function-inspector)) 1159 (+ 1 ; the function 1160 1 ; name 1161 1 ; arglist 1162 (let* ((doc (documentation (inspector-object f) t))) 1163 (if doc 1 0)) 1164 (compute-disassembly-lines f))) 1218 (+ (header-count f) (compute-disassembly-lines f))) 1219 1220 (defmethod line-n-strings ((f function-inspector) n) 1221 (if (< (decf n (header-count f)) 0) 1222 (call-next-method) 1223 (disassembly-line-n-strings f n))) 1224 1225 (defmethod line-n-inspector ((f function-inspector) n value label type) 1226 (declare (ignore value label type)) 1227 (if (< (decf n (header-count f)) 0) 1228 (call-next-method) 1229 (disassembly-line-n-inspector f n))) 1165 1230 1166 1231 (defmethod line-n ((f function-inspector) n) 1167 (let* ((o (inspector-object f)) 1168 (doc (documentation o t))) 1169 (case n 1170 (0 (values o "")) 1171 (1 (values (function-name o) "Name" :colon)) 1172 (2 (multiple-value-bind (arglist type) (arglist o) 1173 (let ((label (if type (format nil "Arglist (~(~a~))" type) "Arglist unknown"))) 1174 (values arglist label (if type :colon '(:comment (:plain))))))) 1175 (3 (if doc 1176 (values (substitute #\space #\newline doc) "Documentation" :colon) 1177 (disassembly-line-n f (- n 3)))) 1178 (t (disassembly-line-n f (- n (if doc 4 3))))))) 1179 1180 (defmethod compute-line-count ((f closure-inspector)) 1232 (let* ((lines (header-lines f)) 1233 (nlines (length lines))) 1234 (if (< n nlines) 1235 (apply #'values (nth n lines)) 1236 (disassembly-line-n f (- n nlines))))) 1237 1238 (defmethod compute-line-count :before ((f closure-inspector)) 1181 1239 (let* ((o (inspector-object f)) 1182 1240 (nclosed (nth-value 8 (function-args (ccl::closure-function o))))) 1183 (setf (closure-n-closed f) nclosed) 1184 (+ (call-next-method) 1185 1 ; the function we close over 1186 1 ; "Closed over values" 1187 nclosed 1188 (if (disasm-p f) 1 0)))) ; "Disassembly" 1241 (setf (closure-n-closed f) nclosed))) 1242 1243 (defmethod header-count ((f closure-inspector)) 1244 (+ (standard-header-count f) 1245 1 ; the function we close over 1246 1 ; "Closed over values" 1247 (closure-n-closed f))) 1189 1248 1190 1249 (defmethod line-n ((f closure-inspector) n) 1191 1250 (let ((o (inspector-object f)) 1192 1251 (nclosed (closure-n-closed f))) 1193 (if (< = (decf n 2) 0)1252 (if (< (decf n (standard-header-count f)) 0) 1194 1253 (call-next-method) 1195 (cond (( eql(decf n) 0)1254 (cond ((< (decf n) 0) 1196 1255 (values (ccl::closure-function o) "Inner lfun: " :static)) 1197 (( eql(decf n) 0)1198 (values nclosed "Closed over values" :comment #'prin1-comment))1199 ((< (decf n)nclosed)1256 ((< (decf n) 0) 1257 (values nclosed "Closed over values" :comment)) 1258 ((< n nclosed) 1200 1259 (let* ((value (ccl::nth-immediate o (1+ (- nclosed n)))) 1201 1260 (map (car (ccl::function-symbol-map (ccl::closure-function o)))) … … 1207 1266 label (format nil "(~a)" label))) 1208 1267 (values value label (if cellp :normal :static) #'prin1-colon-line))) 1209 ((eql (decf n nclosed) 0) 1210 (values 0 "Disassembly" :comment #'prin1-comment)) 1211 (t (disassembly-line-n f (- n 1))))))) 1268 (t (disassembly-line-n f (- n nclosed))))))) 1212 1269 1213 1270 (defmethod (setf line-n) (new-value (f function-inspector) n) 1214 (let ((o (inspector-object f))) 1215 (case n 1216 (0 (replace-object f new-value)) 1217 (1 (ccl::lfun-name o new-value) (resample-it)) 1218 (2 (setf (arglist o) new-value)) 1219 (t 1220 (if (>= n 3) 1221 (set-disassembly-line-n f (- n 3) new-value) 1222 (setf-line-n-out-of-range f n))))) 1271 (let ((o (inspector-object f)) 1272 (standard-header-count (standard-header-count f))) 1273 (if (< n standard-header-count) 1274 (case n 1275 (0 (replace-object f new-value)) 1276 (1 (ccl::lfun-name o new-value) (resample-it)) 1277 (t (setf-line-n-out-of-range f n))) 1278 (set-disassembly-line-n f (- n standard-header-count) new-value))) 1223 1279 new-value) 1224 1280 … … 1226 1282 (let ((o (inspector-object f)) 1227 1283 (nclosed (closure-n-closed f))) 1228 (if (< = (decf n 2) 0) ; function itself, name, or arglist1284 (if (< (decf n (standard-header-count f)) 0) 1229 1285 (call-next-method) 1230 (cond ((< =(decf n 2) 0) ; inner-lfun or "Closed over values"1286 (cond ((< (decf n 2) 0) ; inner-lfun or "Closed over values" 1231 1287 (setf-line-n-out-of-range f en)) 1232 ((< (decf n)nclosed) ; closed-over variable1288 ((< n nclosed) ; closed-over variable 1233 1289 (let* ((value (ccl::nth-immediate o (1+ (- nclosed n)))) 1234 1290 (cellp (ccl::closed-over-value-p value))) 1235 1291 (unless cellp (setf-line-n-out-of-range f en)) 1236 1292 (ccl::set-closed-over-value value new-value))) 1237 ((eql (decf n nclosed) 0) ; "Disassembly" 1238 (setf-line-n-out-of-range f en)) 1239 (t (set-disassembly-line-n f (- n 1) new-value)))))) 1293 (t (set-disassembly-line-n f (- n nclosed) new-value)))))) 1240 1294 1241 1295 (defun compute-disassembly-lines (f &optional (function (inspector-object f))) 1242 (if (functionp function) 1243 (let* ((info (and (disasm-p f) (list-to-vector (ccl::disassemble-list function)))) 1244 (length (length info)) 1245 (last-pc (if info (car (svref info (1- length))) 0))) 1246 (if (listp last-pc) (setq last-pc (cadr last-pc))) 1247 (setf (pc-width f) (length (format nil "~d" last-pc))) 1248 (setf (disasm-info f) info) 1249 length) 1296 (if (and (functionp function) (disasm-p f)) 1297 (let* ((lines (ccl::disassemble-lines function)) ;; list of (object label instr) 1298 (length (length lines)) 1299 (last-label (loop for n from (1- length) downto 0 as line = (aref lines n) 1300 thereis (and (consp line) (cadr line)))) 1301 (max-pc (if (consp last-label) (cadr last-label) last-label))) 1302 (setf (pc-width f) (length (format nil "~d" max-pc))) 1303 (setf (disasm-info f) lines) 1304 (1+ length)) 1250 1305 0)) 1251 1306 1252 (defun list-to-vector (list)1253 (let* ((length (length list))1254 (vec (make-array length)))1255 (dotimes (i length)1256 (declare (fixnum i))1257 (setf (svref vec i) (pop list)))1258 vec))1259 1260 1307 (defun disassembly-line-n (f n) 1261 (let* ((line (svref (disasm-info f) n)) 1262 (value (disasm-line-immediate line))) 1263 (values value line (if value :static :comment)))) 1308 (if (< (decf n) 0) 1309 (values nil "Disassembly:" :comment) 1310 (let ((line (svref (disasm-info f) n))) 1311 (if (consp line) 1312 (destructuring-bind (object label instr) line 1313 (values object (cons label instr) :static)) 1314 (values nil (cons nil line) :static))))) 1315 1316 (defun disassembly-line-n-inspector (f n) 1317 (unless (< (decf n) 0) 1318 (let ((line (svref (disasm-info f) n))) 1319 (and (consp line) 1320 (car line) 1321 (make-inspector (car line)))))) 1322 1323 (defun disassembly-line-n-strings (f n) 1324 (if (< (decf n) 0) 1325 (values "Disassembly:" nil) 1326 (let ((line (svref (disasm-info f) n))) 1327 (if (consp line) 1328 (destructuring-bind (object label instr) line 1329 (declare (ignore object)) 1330 (unless (stringp label) 1331 (setq label (with-output-to-string (stream) 1332 (prin1-disassembly-label f stream label)))) 1333 (values label instr)) 1334 (values nil line))))) 1264 1335 1265 1336 (defun set-disassembly-line-n (f n new-value &optional … … 1268 1339 (setf-line-n-out-of-range f n)) 1269 1340 1270 (defun disasm-line-immediate (line &optional (lookup-functions t)) 1271 (pop line) ; remove address 1272 (when (eq (car line) 'ccl::jsr_subprim) 1273 (return-from disasm-line-immediate (find-symbol (cadr line) :ccl))) 1274 (let ((res nil)) 1275 (labels ((inner-last (l) 1276 (cond ((atom l) l) 1277 ((null (cdr l)) (car l)) 1278 (t (inner-last (last l)))))) 1279 (dolist (e line) 1280 (cond ((numberp e) (when (null res) (setq res e))) 1281 ((consp e) 1282 (cond ((eq (car e) 'function) 1283 (setq res (or (and lookup-functions (fboundp (cadr e))) (cadr e)))) 1284 ((eq (car e) 17) ; locative 1285 (setq e (cadr e)) 1286 (unless (atom e) 1287 (cond ((eq (car e) 'special) 1288 (setq res (cadr e))) 1289 ((eq (car e) 'function) 1290 (setq res (or (and lookup-functions (fboundp (cadr e))) (cadr e)))) 1291 (t (setq res (inner-last e)))))) 1292 ((or (null res) (numberp res)) 1293 (setq res (inner-last e)))))))) 1294 res)) 1295 1296 (defmethod inspector-print-function ((i function-inspector) type) 1297 (declare (ignore type)) 1298 'prin1-normal-line) 1299 1300 (defmethod prin1-label ((f function-inspector) stream value &optional label type) 1341 (defmethod prin1-label ((f function-inspector) stream value &optional data type) 1301 1342 (declare (ignore value type)) 1302 (if (atom label) ; not a disassembly line1343 (if (atom data) ; not a disassembly line 1303 1344 (call-next-method) 1304 (let* ((pc (car label)) 1305 (label-p (and (listp pc) (setq pc (cadr pc)))) 1306 (pc-mark (pc f))) 1307 (if (eq pc pc-mark) 1308 (format stream "*~vd" (pc-width f) pc) 1309 (format stream "~vd" (+ (pc-width f) (if pc-mark 1 0)) pc)) 1310 (write-char (if label-p #\= #\ ) stream)))) 1345 (prin1-disassembly-label f stream (car data)))) 1346 1347 (defun prin1-disassembly-label (f stream label) 1348 (let* ((pc label) 1349 (label-p (and (consp pc) (setq pc (cadr pc)))) 1350 (pc-mark (pc f)) 1351 (pc-width (pc-width f))) 1352 (when pc 1353 (write-char (if (eql pc pc-mark) #\* #\Space) stream) 1354 (format stream "~@[L~d~]~vT~v<[~d]~> " label-p (+ pc-width 3) (+ pc-width 2) pc)))) 1355 1356 #+x86-target 1357 (defmethod prin1-value ((f function-inspector) stream value &optional data type) 1358 (declare (ignore value type)) 1359 (if (atom data) ;; not a disassembly line 1360 (call-next-method) 1361 (princ (cdr data) stream))) 1362 1311 1363 1312 1364 #+ppc-target … … 1327 1379 ;; (They're also inside the dispatch-table which is the first immediate in the disassembly). 1328 1380 (defclass gf-inspector (function-inspector) 1329 ((method-count :accessor method-count) 1330 (slot-count :accessor slot-count :initform 0))) 1381 ((method-count :accessor method-count))) 1331 1382 1332 1383 (defmethod inspector-class ((f standard-generic-function)) … … 1335 1386 'standard-object-inspector)) 1336 1387 1337 (defmethod compute-line-count ((f gf-inspector))1388 (defmethod compute-line-count :before ((f gf-inspector)) 1338 1389 (let* ((gf (inspector-object f)) 1339 (count (length (generic-function-methods gf))) 1340 (res (+ 1 (setf (method-count f) count) 1341 (call-next-method)))) 1342 (if (disasm-p f) (1+ res) res))) 1390 (count (length (generic-function-methods gf)))) 1391 (setf (method-count f) count))) 1392 1393 (defmethod header-count ((f gf-inspector)) 1394 (+ (standard-header-count f) 1 (method-count f))) 1343 1395 1344 1396 (defmethod line-n ((f gf-inspector) n) 1345 1397 (let* ((count (method-count f)) 1346 (slot-count (slot-count f)) 1347 (lines (1+ count))) 1348 (if (<= 3 n (+ lines slot-count 3)) 1349 (let ((methods (generic-function-methods (inspector-object f)))) 1350 (cond ((eql (decf n 3) 0) (values methods "Methods: " :static)) 1351 ((<= n count) 1352 (values (nth (- n 1) methods) nil :static)) 1353 ((< (decf n (1+ count)) slot-count) 1354 (standard-object-line-n f n)) 1355 (t 1356 (values 0 "Disassembly" :comment #'prin1-comment)))) 1357 (call-next-method f (if (< n 3) n (- n lines slot-count 1)))))) 1398 (methods (generic-function-methods (inspector-object f)))) 1399 (cond ((< (decf n (standard-header-count f)) 0) 1400 (call-next-method)) 1401 ((< (decf n) 0) 1402 (values methods "Methods: " :comment)) 1403 ((< n count) 1404 (values (nth n methods) nil :static)) 1405 (t (disassembly-line-n f (- n count)))))) 1358 1406 1359 1407 (defmethod (setf line-n) (new-value (f gf-inspector) n) 1360 1408 (let* ((count (method-count f)) 1361 (slot-count (slot-count f)) 1362 (lines (1+ count))) 1363 (if (<= 3 n (+ lines slot-count 3)) 1364 (let ((en n)) 1365 (cond ((<= (decf en 3) count) 1366 (setf-line-n-out-of-range f n)) 1367 ((< (decf en (1+ count)) slot-count) 1368 (standard-object-setf-line-n new-value f en)) 1369 (t (setf-line-n-out-of-range f n)))) 1370 (call-next-method new-value f (if (< n 3) n (- n lines slot-count 1)))))) 1409 (en n)) 1410 (cond ((< (decf n (standard-header-count f)) 0) 1411 (call-next-method)) 1412 ((< (decf n) count) 1413 (setf-line-n-out-of-range f en)) 1414 (t (set-disassembly-line-n f (- n count) new-value))))) 1371 1415 1372 1416 #| … … 1383 1427 (call-next-method)))) 1384 1428 |# 1385 1386 (defclass method-inspector (standard-object-inspector function-inspector)1387 ((standard-object-lines :accessor standard-object-lines)))1388 1389 (defmethod inspector-class ((object standard-method))1390 'method-inspector)1391 1392 (defmethod compute-line-count ((i method-inspector))1393 (+ (setf (standard-object-lines i) (call-next-method))1394 (if (disasm-p i) 1 0) ; "Disassembly"1395 (compute-disassembly-lines i (method-function (inspector-object i)))))1396 1397 (defmethod line-n ((i method-inspector) n)1398 (let ((sol (standard-object-lines i)))1399 (cond ((< n sol) (call-next-method))1400 ((eql n sol) (values nil "Disassembly" :comment))1401 (t (disassembly-line-n i (- n sol 1))))))1402 1403 (defmethod (setf line-n) (new-value (i method-inspector) n)1404 (let ((sol (standard-object-lines i)))1405 (cond ((< n sol) (call-next-method))1406 ((eql n sol) (setf-line-n-out-of-range i n))1407 (t (set-disassembly-line-n1408 i n new-value (method-function (inspector-object i)))))))1409 1410 ;;; funtion-inspector never does prin1-comment.1411 (defmethod prin1-normal-line ((i method-inspector) stream value &optional1412 label type colon-p)1413 (declare (ignore colon-p))1414 (if (eq type :comment)1415 (prin1-comment i stream value label type)1416 (call-next-method)))1417 1418 1429 1419 1430 ;;;;;;; … … 1565 1576 1566 1577 (defmethod initialize-addresses ((f error-frame)) 1567 (let* ((addresses ( list-to-vector (ccl::%stack-frames-in-context (context f)))))1578 (let* ((addresses (coerce (ccl::%stack-frames-in-context (context f)) 'vector))) 1568 1579 (setf (frame-count f) (length addresses) 1569 1580 (addresses f) addresses))) … … 1786 1797 (defmethod ui-present ((ui inspector-tty-ui)) 1787 1798 (let* ((inspector (inspector-ui-inspector ui))) 1788 (when (null (inspector-line-count inspector))1789 (update-line-count inspector))1790 1799 (with-errorfree-printing 1791 1800 (let* ((stream *debug-io*) … … 1795 1804 (n (compute-line-count inspector)) 1796 1805 (end (min page-end n)) 1797 (tag origin)1806 (tag -1) 1798 1807 (*print-pretty* (or *print-pretty* *describe-pretty*)) 1799 1808 (*print-length* 5) 1800 1809 (*print-level* 5) 1801 (func #'(lambda (i value &rest rest) 1802 (declare (dynamic-extent rest)) 1803 (let* ((type (cadr rest))) 1804 (unless (or (eq type :comment) 1805 (and (consp type) 1806 (eq (car type) :comment))) 1807 (format stream "[~d] " tag)) 1808 (incf tag)) 1809 (format stream "~8t") 1810 (apply #'prin1-line i stream value rest) 1811 (terpri stream)))) 1810 (func #'(lambda (i index child &optional label-string value-string) 1811 (declare (ignore i)) 1812 (when child (incf tag)) 1813 (unless (< index origin) 1814 (format stream "~@[[~d]~]~8t" (and child tag)) 1815 (format-line-for-tty stream label-string value-string) 1816 (terpri stream))))) 1812 1817 (declare (dynamic-extent func)) 1813 (map-lines inspector func originend)))1818 (map-lines inspector func 0 end))) 1814 1819 (values))) 1815 1820 … … 1893 1898 1894 1899 (defmethod inspector-ui-inspect-nth ((ui inspector-tty-ui) n) 1895 (let* ((inspector (inspector-ui-inspector ui))) 1896 (multiple-value-bind (value label type) 1897 (line-n inspector n) 1898 (unless (or (eq type :comment) 1899 (and (consp type) (eq (car type) :comment))) 1900 (let* ((new-inspector (line-n-inspector inspector n value label type)) 1901 (ccl::@ value)) 1902 (inspector-ui-inspect 1903 (make-instance 'inspector-tty-ui 1904 :level (1+ (inspector-ui-level ui)) 1905 :inspector new-inspector))))))) 1906 1900 (let* ((inspector (inspector-ui-inspector ui)) 1901 (new-inspector (block nil 1902 (let* ((tag -1) 1903 (func #'(lambda (i index child &rest strings) 1904 (declare (ignore i index strings)) 1905 (when (and child (eql (incf tag) n)) (return child))))) 1906 (declare (dynamic-extent func)) 1907 (map-lines inspector func)))) 1908 (ccl::@ (inspector-object new-inspector))) 1909 (inspector-ui-inspect 1910 (make-instance 'inspector-tty-ui 1911 :level (1+ (inspector-ui-level ui)) 1912 :inspector new-inspector)))) 1913 1907 1914 (defparameter *default-inspector-ui-class-name* 'inspector-tty-ui) 1908 1915 -
branches/working-0711/ccl/lib/misc.lisp
r12935 r12949 774 774 disassemble." 775 775 (#+ppc-target ppc-xdisassemble 776 #+x8632-target x8632-xdisassemble 777 #+x8664-target x8664-xdisassemble 776 #+x86-target x86-xdisassemble 778 777 (require-type (function-for-disassembly thing) 'compiled-function))) 779 778
Note:
See TracChangeset
for help on using the changeset viewer.
