Changeset 12885
- Timestamp:
- Sep 26, 2009, 8:39:26 PM (15 years ago)
- Location:
- branches/watchpoints
- Files:
-
- 4 edited
-
level-0/X86/x86-utils.lisp (modified) (1 diff)
-
level-1/x86-trap-support.lisp (modified) (2 diffs)
-
lib/misc.lisp (modified) (2 diffs)
-
lisp-kernel/x86-exceptions.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/watchpoints/level-0/X86/x86-utils.lisp
r12837 r12885 445 445 (jmp-subprim .SPmakeu64)) 446 446 447 (defx86lapfunction %watch (( uvectorarg_z))447 (defx86lapfunction %watch ((thing arg_z)) 448 448 (check-nargs 1) 449 ;; This traps on symbols and functions, which have their own tags.450 ;; This may be undesirable.451 (trap-unless-lisptag= uvector x8664::tag-misc imm0)452 449 (movl ($ arch::watch-trap-function-watch) (%l imm0)) 453 450 (uuo-watch-trap) -
branches/watchpoints/level-1/x86-trap-support.lisp
r12881 r12885 441 441 :object object) 442 442 nil frame-ptr) 443 (unwatch ()444 :report (lambda (s)445 (format s "Unwatch ~s and perform the write." object))446 (unwatch (%int-to-object other)))))))))443 (unwatch () 444 :report (lambda (s) 445 (format s "Unwatch ~s and perform the write." object)) 446 (unwatch object)))))))) 447 447 ((= signal #+win32-target 10 #-win32-target #$SIGBUS) 448 448 (if (= code -1) … … 456 456 frame-ptr))))) 457 457 0) 458 459 #||460 (defun analyze-faulting-instruction (xp)461 (let* ((ds (make-x86-disassembly-state462 :mode-64 #+x8664-target t #+x8632-target nil))463 (insn (make-x86-disassembled-instruction464 :address (indexed-gpr-integer xp rip-register-offset)465 ||# -
branches/watchpoints/lib/misc.lisp
r12838 r12885 1046 1046 (defun watch (&optional thing) 1047 1047 (if thing 1048 ;; typecheck thing? 1049 (%watch thing) 1048 (progn 1049 (require-type thing '(or cons (satisfies uvectorp))) 1050 (%watch thing)) 1050 1051 (let (result) 1051 1052 (%map-areas #'(lambda (x) (push x result)) area-watched area-watched) … … 1059 1060 ;; list while %map-areas iterates over it, but I 1060 1061 ;; think we'll get away with it. 1061 (let ((new (%alloc-misc (uvsize thing) (typecode thing)))) 1062 (let ((new (if (uvectorp thing) 1063 (%alloc-misc (uvsize thing) (typecode thing)) 1064 (cons nil nil)))) 1062 1065 (return-from unwatch (%unwatch thing new))))) 1063 1066 area-watched area-watched)) -
branches/watchpoints/lisp-kernel/x86-exceptions.c
r12880 r12885 827 827 if (a && a->code == AREA_WATCHED && addr < a->high) { 828 828 /* caught a write to a watched object */ 829 LispObj *p = (LispObj *)a->low; 830 LispObj node = *p; 831 unsigned tag_n = fulltag_of(node); 829 832 LispObj cmain = nrs_CMAIN.vcell; 830 LispObj obj = (LispObj)a->low + fulltag_misc; /* always uvectors */ 833 LispObj obj; 834 835 if (immheader_tag_p(tag_n) || nodeheader_tag_p(tag_n)) 836 obj = (LispObj)p + fulltag_misc; 837 else 838 obj = (LispObj)p + fulltag_cons; 831 839 832 840 if ((fulltag_of(cmain) == fulltag_misc) && … … 3706 3714 * Other threads are suspended and pc-lusered. 3707 3715 * 3708 * param contains a tagged pointer to a uvector .3716 * param contains a tagged pointer to a uvector or a cons cell 3709 3717 */ 3710 3718 signed_natural 3711 3719 watch_object(TCR *tcr, signed_natural param) 3712 3720 { 3713 LispObj uvector = (LispObj)param; 3714 LispObj *noderef = (LispObj *)untag(uvector); 3715 natural size = uvector_total_size_in_bytes(noderef); 3716 area *uvector_area = area_containing((BytePtr)noderef); 3717 3718 if (uvector_area && uvector_area->code != AREA_WATCHED) { 3721 LispObj object = (LispObj)param; 3722 unsigned tag = fulltag_of(object); 3723 LispObj *noderef = (LispObj *)untag(object); 3724 area *object_area = area_containing((BytePtr)noderef); 3725 natural size; 3726 3727 if (tag == fulltag_cons) 3728 size = 2 * node_size; 3729 else 3730 size = uvector_total_size_in_bytes(noderef); 3731 3732 if (object_area && object_area->code != AREA_WATCHED) { 3719 3733 area *a = new_watched_area(size); 3720 LispObj old = uvector;3721 LispObj new = (LispObj)((natural)a->low + fulltag_misc);3734 LispObj old = object; 3735 LispObj new = (LispObj)((natural)a->low + tag); 3722 3736 3723 3737 add_area_holding_area_lock(a); … … 3742 3756 ExceptionInformation *xp = tcr->xframe->curr; 3743 3757 LispObj old = xpGPR(xp, Iarg_y); 3758 unsigned tag = fulltag_of(old); 3744 3759 LispObj new = xpGPR(xp, Iarg_z); 3745 3760 LispObj *oldnode = (LispObj *)untag(old); … … 3748 3763 3749 3764 if (a && a->code == AREA_WATCHED) { 3750 natural size = uvector_total_size_in_bytes(oldnode); 3765 natural size; 3766 3767 if (tag == fulltag_cons) 3768 size = 2 * node_size; 3769 else 3770 size = uvector_total_size_in_bytes(oldnode); 3751 3771 3752 3772 memcpy(newnode, oldnode, size); … … 3765 3785 { 3766 3786 LispObj selector = xpGPR(xp,Iimm0); 3767 LispObj uvector= xpGPR(xp, Iarg_z);3787 LispObj object = xpGPR(xp, Iarg_z); 3768 3788 3769 3789 switch (selector) { 3770 3790 case WATCH_TRAP_FUNCTION_WATCH: 3771 gc_like_from_xp(xp, watch_object, uvector);3791 gc_like_from_xp(xp, watch_object, object); 3772 3792 break; 3773 3793 case WATCH_TRAP_FUNCTION_UNWATCH:
Note:
See TracChangeset
for help on using the changeset viewer.
