Skip to content

Commit

Permalink
change 05 to fix issue #103
Browse files Browse the repository at this point in the history
  • Loading branch information
brunobuzzi committed Aug 13, 2018
1 parent 97b37f4 commit 2a8f00c
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 27 deletions.
2 changes: 1 addition & 1 deletion sources/uml/UML Live Engine.pax
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ UMLObject subclass: #UMLExecutionSnapshot
poolDictionaries: ''
classInstanceVariableNames: ''!
UMLObject subclass: #UMLExecutionStack
instanceVariableNames: 'virtualMachine creatorSnapshot currentSnapshots executedSnapshots dnuSnapshot infiniteLoopSnapshot onErrorDoSnapshot'
instanceVariableNames: 'virtualMachine creatorSnapshot currentSnapshots executedSnapshots dnuSnapshot infiniteLoopSnapshot exceptionSnapshot onErrorDoSnapshot'
classVariableNames: ''
poolDictionaries: ''
classInstanceVariableNames: ''!
Expand Down
31 changes: 21 additions & 10 deletions sources/uml/UMLExecutionSnapshot.cls
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ cascadeTemporaries: anObject

catchException

hasOnErrorDo := true!
hasOnErrorDo := true.

parentStack onErrorDoSnapshot: self!

className

Expand Down Expand Up @@ -109,8 +111,11 @@ currentUser: anObject
exception
^exception!

exception: anObject
exception := anObject!
exception: exceptionObject

exception := exceptionObject.

parentStack exceptionSnapshot: exceptionObject.!

executedImplementations
^executedImplementations!
Expand Down Expand Up @@ -188,8 +193,11 @@ getTemporaryNamed: aString
hasDNU
^hasDNU!

hasDNU: anObject
hasDNU := anObject!
hasDNU: aBoolean

hasDNU := aBoolean.

aBoolean ifTrue: [parentStack dnuSnapshot: self]!

hasException

Expand All @@ -202,8 +210,11 @@ hasExecuted: anUMLMessageNode
hasInfiniteLoop
^hasInfiniteLoop!

hasInfiniteLoop: anObject
hasInfiniteLoop := anObject!
hasInfiniteLoop: aBoolean

hasInfiniteLoop := aBoolean.

aBoolean ifTrue: [parentStack infiniteLoopSnapshot: self].!

hasOnErrorDo
^hasOnErrorDo!
Expand Down Expand Up @@ -556,7 +567,7 @@ virtualMachine: anObject
!UMLExecutionSnapshot categoriesFor: #canStepIn!public! !
!UMLExecutionSnapshot categoriesFor: #cascadeTemporaries!accessing!private! !
!UMLExecutionSnapshot categoriesFor: #cascadeTemporaries:!accessing!private! !
!UMLExecutionSnapshot categoriesFor: #catchException!public! !
!UMLExecutionSnapshot categoriesFor: #catchException!public!vm stack! !
!UMLExecutionSnapshot categoriesFor: #className!public! !
!UMLExecutionSnapshot categoriesFor: #clearExecutedImplementations!public! !
!UMLExecutionSnapshot categoriesFor: #createBlockFrom:!public! !
Expand All @@ -565,7 +576,7 @@ virtualMachine: anObject
!UMLExecutionSnapshot categoriesFor: #currentUser!accessing!private! !
!UMLExecutionSnapshot categoriesFor: #currentUser:!accessing!private! !
!UMLExecutionSnapshot categoriesFor: #exception!accessing!private! !
!UMLExecutionSnapshot categoriesFor: #exception:!accessing!private! !
!UMLExecutionSnapshot categoriesFor: #exception:!accessing!public!vm stack! !
!UMLExecutionSnapshot categoriesFor: #executedImplementations!accessing!private! !
!UMLExecutionSnapshot categoriesFor: #executedImplementations:!accessing!private! !
!UMLExecutionSnapshot categoriesFor: #executedNodes!accessing!private! !
Expand All @@ -579,7 +590,7 @@ virtualMachine: anObject
!UMLExecutionSnapshot categoriesFor: #getReceiverObjectFrom:!private!processesing! !
!UMLExecutionSnapshot categoriesFor: #getTemporaryNamed:!public! !
!UMLExecutionSnapshot categoriesFor: #hasDNU!accessing!private! !
!UMLExecutionSnapshot categoriesFor: #hasDNU:!accessing!private! !
!UMLExecutionSnapshot categoriesFor: #hasDNU:!accessing!public!vm stack! !
!UMLExecutionSnapshot categoriesFor: #hasException!exceptions!public! !
!UMLExecutionSnapshot categoriesFor: #hasExecuted:!processesing!public! !
!UMLExecutionSnapshot categoriesFor: #hasInfiniteLoop!accessing!private! !
Expand Down
52 changes: 37 additions & 15 deletions sources/uml/UMLExecutionStack.cls
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"Filed out from Dolphin Smalltalk 7"!

UMLObject subclass: #UMLExecutionStack
instanceVariableNames: 'virtualMachine creatorSnapshot currentSnapshots executedSnapshots dnuSnapshot infiniteLoopSnapshot onErrorDoSnapshot'
instanceVariableNames: 'virtualMachine creatorSnapshot currentSnapshots executedSnapshots dnuSnapshot infiniteLoopSnapshot exceptionSnapshot onErrorDoSnapshot'
classVariableNames: ''
poolDictionaries: ''
classInstanceVariableNames: ''!
Expand All @@ -28,8 +28,16 @@ currentSnapshots: anObject
dnuSnapshot
^dnuSnapshot!

dnuSnapshot: anObject
dnuSnapshot := anObject!
dnuSnapshot: anUMLExecutionSnapshot

dnuSnapshot := anUMLExecutionSnapshot!

exceptionSnapshot
^exceptionSnapshot!

exceptionSnapshot: anUMLExecutionSnapshot

exceptionSnapshot := anUMLExecutionSnapshot!

executedSnapshots
^executedSnapshots!
Expand All @@ -42,16 +50,25 @@ hasDNU

^dnuSnapshot notNil!

hasException

^exceptionSnapshot notNil!

hasInfiniteLoop
"The receiver answer whether or not there is an infinite loop in the execution"

^infiniteLoopSnapshot notNil!

hasOnErrorDo

^onErrorDoSnapshot notNil!

infiniteLoopSnapshot
^infiniteLoopSnapshot!

infiniteLoopSnapshot: anObject
infiniteLoopSnapshot := anObject!
infiniteLoopSnapshot: anUMLExecutionSnapshot

infiniteLoopSnapshot := anUMLExecutionSnapshot!

initialize

Expand All @@ -63,8 +80,9 @@ initialize
onErrorDoSnapshot
^onErrorDoSnapshot!

onErrorDoSnapshot: anObject
onErrorDoSnapshot := anObject!
onErrorDoSnapshot: anUMLExecutionSnapshot

onErrorDoSnapshot := anUMLExecutionSnapshot!

registerCurrentStackItem: anUMLExecutionSnapshot
"The receiver register <anUMLExecutionSnapshot> to the current stack"
Expand All @@ -90,22 +108,26 @@ virtualMachine
virtualMachine: anObject
virtualMachine := anObject! !
!UMLExecutionStack categoriesFor: #creatorSnapshot!accessing!private! !
!UMLExecutionStack categoriesFor: #creatorSnapshot:!accessing!public! !
!UMLExecutionStack categoriesFor: #creatorSnapshot:!accessing!public!snapshot handler! !
!UMLExecutionStack categoriesFor: #currentSnapshots!accessing!private! !
!UMLExecutionStack categoriesFor: #currentSnapshots:!accessing!private! !
!UMLExecutionStack categoriesFor: #dnuSnapshot!accessing!private! !
!UMLExecutionStack categoriesFor: #dnuSnapshot:!accessing!private! !
!UMLExecutionStack categoriesFor: #dnuSnapshot:!accessing!public!snapshot handler! !
!UMLExecutionStack categoriesFor: #exceptionSnapshot!accessing!private! !
!UMLExecutionStack categoriesFor: #exceptionSnapshot:!accessing!public!snapshot handler! !
!UMLExecutionStack categoriesFor: #executedSnapshots!accessing!private! !
!UMLExecutionStack categoriesFor: #executedSnapshots:!accessing!private! !
!UMLExecutionStack categoriesFor: #hasDNU!public! !
!UMLExecutionStack categoriesFor: #hasInfiniteLoop!public! !
!UMLExecutionStack categoriesFor: #hasDNU!public!testing! !
!UMLExecutionStack categoriesFor: #hasException!public!testing! !
!UMLExecutionStack categoriesFor: #hasInfiniteLoop!public!testing! !
!UMLExecutionStack categoriesFor: #hasOnErrorDo!public!testing! !
!UMLExecutionStack categoriesFor: #infiniteLoopSnapshot!accessing!private! !
!UMLExecutionStack categoriesFor: #infiniteLoopSnapshot:!accessing!private! !
!UMLExecutionStack categoriesFor: #infiniteLoopSnapshot:!accessing!public!snapshot handler! !
!UMLExecutionStack categoriesFor: #initialize!public! !
!UMLExecutionStack categoriesFor: #onErrorDoSnapshot!accessing!private! !
!UMLExecutionStack categoriesFor: #onErrorDoSnapshot:!accessing!private! !
!UMLExecutionStack categoriesFor: #registerCurrentStackItem:!public! !
!UMLExecutionStack categoriesFor: #registerExecutedStackItem:!public! !
!UMLExecutionStack categoriesFor: #onErrorDoSnapshot:!accessing!public!snapshot handler! !
!UMLExecutionStack categoriesFor: #registerCurrentStackItem:!public!snapshot handler! !
!UMLExecutionStack categoriesFor: #registerExecutedStackItem:!public!snapshot handler! !
!UMLExecutionStack categoriesFor: #virtualMachine!accessing!private! !
!UMLExecutionStack categoriesFor: #virtualMachine:!accessing!private! !

Expand Down
2 changes: 1 addition & 1 deletion sources/uml/UMLVirtualMachine.cls
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ apply: anUMLImplementation to: anUMLObject with: arguments snapshot: anUMLExecut
anUMLExecutionSnapshot hasDNU
ifTrue: [ self errorLogIsActive "Here we register the error in the UMLVMTransLog"
ifTrue: [self registerTransErrorLogFor: anUMLObject methodName: arguments arguments: arguments snapshot: anUMLExecutionSnapshot].
"^self nilObject"]]
^collectionResult]]
ifTrue: [^self processPrimitiveCallHaltIn: anUMLExecutionSnapshot node: each object: anUMLObject]. "debug interruption"]
].
anUMLExecutionSnapshot finalizeSnapshot. "move the snapshot from current to executed in the Stack"
Expand Down

0 comments on commit 2a8f00c

Please sign in to comment.