Ignore:
Timestamp:
Sep 16, 2009, 6:33:00 PM (10 years ago)
Author:
gz
Message:

Make the gui inspector show function disassembly. Extend the inspector protocol to support this a little better. Fix a number of bugs in closing and method inspectors.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/compiler/PPC/ppc-disassemble.lisp

    r11373 r12846  
    435435    (nreverse res)))
    436436
     437(defun disassemble-lines (thing)
     438  (let ((dll (function-to-dll-header (function-for-disassembly thing)))
     439        (address 0)
     440        (label-p nil)
     441        (lines (make-array 20 :adjustable t :fill-pointer 0)))
     442    (do-dll-nodes (i dll)
     443      (setq address (instruction-element-address i))
     444      (etypecase i
     445        (lap-label
     446         (setq label-p (lap-label-name i)))
     447        (lap-instruction
     448         (let* ((opcode (lap-instruction-opcode i))
     449                (operands (lap-instruction-parsed-operands i))
     450                (imms (loop for op in operands
     451                         when (and (consp op)
     452                                   (consp (cdr op))
     453                                   (null (cddr op))
     454                                   (or (eq (%car op) 'quote) (eq (%car op) 'function)))
     455                         collect op)))
     456           (vector-push-extend (list (if (cdr imms) (coerce imms 'vector) (car imms))
     457                                     (if label-p `(:label address) address)
     458                                     (with-output-to-string (s)
     459                                       (format s "(~a" (if (symbolp opcode) opcode (opcode-name opcode)))
     460                                       (loop for op in operands
     461                                          do (princ " " s)
     462                                          do (disasm-prin1 op s))
     463                                       (format s ")")))
     464                               lines)
     465           (setq label-p nil)))))
     466    lines))
     467
    437468#+ppc-target
    438469(defun disasm-prin1 (thing stream)
Note: See TracChangeset for help on using the changeset viewer.