Changeset 9377


Ignore:
Timestamp:
May 6, 2008, 5:26:42 PM (11 years ago)
Author:
rme
Message:

Add x8632-xdisassemble.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/ia32/compiler/X86/x86-disassemble.lisp

    r8161 r9377  
    28012801      (setf (uvref xfunction j) (uvref fv k)))))
    28022802
     2803#+x8632-target
     2804(defun x8632-xdisassemble (function &optional (collect-function #'x86-print-disassembled-instruction ))
     2805  (let* ((fv (function-to-function-vector function))
     2806         (function-size-in-words (uvsize fv))
     2807         (code-words (%function-code-words function))
     2808         (ncode-bytes (ash function-size-in-words x8632::word-shift))
     2809         (code-bytes (make-array ncode-bytes
     2810                                 :element-type '(unsigned-byte 8)))
     2811         (numimms (- function-size-in-words code-words))
     2812         (xfunction (%alloc-misc (the fixnum (1+ numimms)) target::subtag-xfunction)))
     2813    (declare (fixnum code-words ncode-bytes numimms))
     2814    (%copy-ivector-to-ivector fv 0 code-bytes 0 ncode-bytes)
     2815    (setf (uvref xfunction 0) code-bytes)
     2816    (do* ((k code-words (1+ k))
     2817          (j 1 (1+ j)))
     2818         ((= k function-size-in-words)
     2819          (x8632-disassemble-xfunction xfunction :collect-function collect-function))
     2820      (declare (fixnum j k))
     2821      (setf (uvref xfunction j) (uvref fv k)))))
     2822
    28032823(defun disassemble-list (function)
    28042824  (collect ((instructions))
Note: See TracChangeset for help on using the changeset viewer.