entries for access traps (for now: dummy entries)
authorClaus Gittinger <cg@exept.de>
Wed, 06 Dec 1995 12:58:28 +0100
changeset 683 83b5e1f9028f
parent 682 a10f434805a7
child 684 3e0b5a8ec381
entries for access traps (for now: dummy entries)
ObjMem.st
ObjectMemory.st
--- a/ObjMem.st	Tue Dec 05 20:19:06 1995 +0100
+++ b/ObjMem.st	Wed Dec 06 12:58:28 1995 +0100
@@ -2301,6 +2301,57 @@
     "
 ! !
 
+!ObjectMemory class methodsFor:'access debugging'!
+
+setTrapOnReadFor:anObject
+    "install a read trap for anObject;
+     An accessSignal will be raised, whenever any access into anObject occurrs.
+     This is not supported on all architectures, therefore the return value
+     (true of trap was installed ok, false if failed) should be checked."
+
+%{  /* NOCONTEXT */
+    RETURN (__addTrapOnAccess__(anObject, 0) ? true : false);
+%}
+!
+
+setTrapOnWriteFor:anObject
+    "install a write trap for anObject;
+     An accessSignal will be raised, whenever any instvar of anObject is written to.
+     This is not supported on all architectures, therefore the return value
+     (true of trap was installed ok, false if failed) should be checked."
+
+%{  /* NOCONTEXT */
+    RETURN (__addTrapOnAccess__(anObject, 1) ? true : false);
+%}
+!
+
+setTrapOnAccessFor:anObject
+    "install an access trap for anObject;
+     An accessSignal will be raised, whenever any instvar of anObject is either read or written.
+     This is not supported on all architectures, therefore the return value
+     (true of trap was installed ok, false if failed) should be checked."
+
+%{  /* NOCONTEXT */
+    RETURN (__addTrapOnAccess__(anObject, 2) ? true : false);
+%}
+!
+
+unsetTrapFor:anObject
+    "remove any access trap for anObject."
+
+%{  /* NOCONTEXT */
+    __removeTrapOnAccess__(anObject);
+%}
+!
+
+unsetAllTraps
+    "remove all access traps"
+
+%{  /* NOCONTEXT */
+    __removeAllAccessTraps__();
+%} 
+! !
+ 
 !ObjectMemory class methodsFor:'physical memory access'!
 
 collectedOldSpacePagesDo:aBlock
@@ -3167,6 +3218,6 @@
 !ObjectMemory class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Attic/ObjMem.st,v 1.80 1995-11-24 20:48:43 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Attic/ObjMem.st,v 1.81 1995-12-06 11:58:28 cg Exp $'
 ! !
 ObjectMemory initialize!
--- a/ObjectMemory.st	Tue Dec 05 20:19:06 1995 +0100
+++ b/ObjectMemory.st	Wed Dec 06 12:58:28 1995 +0100
@@ -2301,6 +2301,57 @@
     "
 ! !
 
+!ObjectMemory class methodsFor:'access debugging'!
+
+setTrapOnReadFor:anObject
+    "install a read trap for anObject;
+     An accessSignal will be raised, whenever any access into anObject occurrs.
+     This is not supported on all architectures, therefore the return value
+     (true of trap was installed ok, false if failed) should be checked."
+
+%{  /* NOCONTEXT */
+    RETURN (__addTrapOnAccess__(anObject, 0) ? true : false);
+%}
+!
+
+setTrapOnWriteFor:anObject
+    "install a write trap for anObject;
+     An accessSignal will be raised, whenever any instvar of anObject is written to.
+     This is not supported on all architectures, therefore the return value
+     (true of trap was installed ok, false if failed) should be checked."
+
+%{  /* NOCONTEXT */
+    RETURN (__addTrapOnAccess__(anObject, 1) ? true : false);
+%}
+!
+
+setTrapOnAccessFor:anObject
+    "install an access trap for anObject;
+     An accessSignal will be raised, whenever any instvar of anObject is either read or written.
+     This is not supported on all architectures, therefore the return value
+     (true of trap was installed ok, false if failed) should be checked."
+
+%{  /* NOCONTEXT */
+    RETURN (__addTrapOnAccess__(anObject, 2) ? true : false);
+%}
+!
+
+unsetTrapFor:anObject
+    "remove any access trap for anObject."
+
+%{  /* NOCONTEXT */
+    __removeTrapOnAccess__(anObject);
+%}
+!
+
+unsetAllTraps
+    "remove all access traps"
+
+%{  /* NOCONTEXT */
+    __removeAllAccessTraps__();
+%} 
+! !
+ 
 !ObjectMemory class methodsFor:'physical memory access'!
 
 collectedOldSpacePagesDo:aBlock
@@ -3167,6 +3218,6 @@
 !ObjectMemory class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ObjectMemory.st,v 1.80 1995-11-24 20:48:43 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ObjectMemory.st,v 1.81 1995-12-06 11:58:28 cg Exp $'
 ! !
 ObjectMemory initialize!