Changeset 13022


Ignore:
Timestamp:
Oct 15, 2009, 2:50:30 AM (10 years ago)
Author:
rme
Message:

Super-fancy print-object method for an x86-disassembled-instruction.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/compiler/X86/x86-disassemble.lisp

    r13001 r13022  
    3636(defmethod print-object ((xdi x86-disassembled-instruction) stream)
    3737  (print-unreadable-object (xdi stream :type t :identity t)
    38     (format stream "~a" (x86-di-mnemonic xdi))))
     38    (dolist (p (x86-di-prefixes xdi))
     39      (format stream "(~a) " p))
     40    (format stream "(~a" (x86-di-mnemonic xdi))
     41    (let* ((op0 (x86-di-op0 xdi))
     42           (op1 (x86-di-op1 xdi))
     43           (op2 (x86-di-op2 xdi))
     44           (ds (make-x86-disassembly-state :mode-64 #+x8664-target t
     45                                                    #+x8632-target nil
     46                                           :code-vector nil
     47                                           :code-pointer 0)))
     48      (when op0
     49        (write-x86-lap-operand stream op0 ds)
     50        (when op1
     51          (write-x86-lap-operand stream op1 ds)
     52          (when op2
     53            (write-x86-lap-operand stream op2 ds)))))
     54    (format stream ")")))
    3955
    4056(defstruct (x86-disassembly-state (:conc-name x86-ds-))
Note: See TracChangeset for help on using the changeset viewer.