Changeset 10486


Ignore:
Timestamp:
Aug 18, 2008, 12:32:59 PM (11 years ago)
Author:
gb
Message:

When disassembling ia32 code, treat (movl ($ n) (% fn)) as
(recover-fn).

File:
1 edited

Legend:

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

    r10202 r10486  
    161161;;; x86 functions and this approach means that we won't try to
    162162;;; disassemble any of that; if the compiler generates any unreachable
    163 
    164 ;;; code, we won't seen that, either.
     163;;; code, we won't see that, either.
    165164
    166165;;; There might be a large number of blocks, in which case
     
    23582357  ;; If the instruction is adding a displacement to RIP, note
    23592358  ;; the effective address as a label reference.
     2359  ;; On ia32, if op0 is a 32-bit immediate and op1 is (% fn),
     2360  ;; treat the immediate as :self.
    23602361  (let* ((op0 (x86-di-op0 instruction))
    23612362         (op1 (x86-di-op1 instruction))
     
    24372438                 (when info (setf (x86::x86-memory-operand-disp op0)
    24382439                                  (subprimitive-info-name info)))))))
     2440          (t
     2441           (unless (x86-ds-mode-64 ds)
     2442             (when (and (is-fn op1)
     2443                        (typep op0 'x86::x86-immediate-operand)
     2444                        ;; Not sure what else would have an
     2445                        ;; immediate source and %fn as destination,
     2446                        ;; but check for this.
     2447                        (equal (x86-di-mnemonic instruction) "movl"))
     2448               (setf (x86-di-mnemonic instruction) "recover-fn"
     2449                     (x86-di-op0 instruction) nil
     2450                     (x86-di-op0 instruction) nil))))
    24392451
    24402452          )))
     
    28282840(defun disassemble-list (function)
    28292841  (collect ((instructions))
    2830     (x8664-xdisassemble
     2842    (#+x8632-target x8632-xdisassemble #+x8664-target x8664-xdisassemble
    28312843     function
    28322844     #'(lambda (ds instruction seq)
Note: See TracChangeset for help on using the changeset viewer.