Ignore:
Timestamp:
Sep 12, 2009, 2:04:47 AM (10 years ago)
Author:
rme
Message:

When reporting a write-to-watched-object condition, try to figure out
and report the uvector index from the faulting address.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-1/l1-error-system.lisp

    r12819 r12821  
    108108  (:report (lambda (c s)
    109109             (with-slots (object address) c
    110                (format s "Write to watched object ~s at ~s." object address)))))
     110               (if (uvectorp object)
     111                 ;; This is safe only because watched objects are in a
     112                 ;; static GC area and won't be moved around.
     113                 (let* ((size (uvsize object))
     114                        (nbytes (if (ivectorp object)
     115                                  (subtag-bytes (typecode object) size)
     116                                  (* size target::node-size)))
     117                        (bytes-per-element (/ nbytes size))
     118                        (noderef (logandc2 (%address-of object)
     119                                           target::fulltagmask))
     120                        (offset (- address (+ noderef target::node-size)))
     121                        (index (/ offset bytes-per-element)))
     122                   (format s "Write to watched object ~s at address #x~x (uvector index ~d)." object address index))
     123                 (format s "Write to watched object ~s at address #x~x" object address))))))
    111124
    112125(define-condition type-error (error)
Note: See TracChangeset for help on using the changeset viewer.