Changeset 14843 for trunk/source/level-1


Ignore:
Timestamp:
Jun 23, 2011, 6:33:09 AM (8 years ago)
Author:
gb
Message:

Provide some help in determining arithmetic-error operation/operands
by partial disassembly.

Use that help when we get an FPU exception.

If (%ERR-DISP $XDIVZRO ...) is called with a second operand, use that
as the first ARITHMETIC-ERROR-OPERAND in the resulting condition.

Pass that argument from ARM subrprims that can signal division-by-zero
from software.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-1/arm-error-signal.lisp

    r14807 r14843  
    115115    ;; handle_uuo() (in the lisp kernel) will not bump the PC here.
    116116    (setf (xp-gpr-lisp xp arm::pc) (uvref f 0))))
    117    
     117
     118 
    118119(defcallback %xerr-disp (:address xp
    119120                                  :signed-fullword error-number
     
    244245                        (5              ;fpu
    245246                         (let* ((reginfo (xp-gpr-lisp xp (ldb (byte 4 8) uuo)))
     247                                (instruction (logand (xp-gpr-signed-long xp (ldb (byte 4 12) uuo)) (1- (ash 1 32))))
    246248                                (condition-name (fp-condition-name-from-fpscr-status (aref reginfo 0))))
    247249                           (if condition-name
    248                              (%error condition-name nil frame-ptr)
     250                             (let* ((template (find-arm-instruction-template instruction))
     251                                    (operation (if template (arithmetic-error-operation-from-instruction template) 'unknown))
     252                                    (operands (if template (arithmetic-error-operands-from-instruction template instruction reginfo xp))))
     253                               (%error condition-name `(:operation ,operation :operands ,operands) frame-ptr))
    249254                             (%error "FPU exception, fpscr = ~d" (list (aref reginfo 0)) frame-ptr)))
    250255                         )
Note: See TracChangeset for help on using the changeset viewer.