Skip to content

Commit

Permalink
Make #runSimulated:contextAtEachStep: aware of contexts that don't #c…
Browse files Browse the repository at this point in the history
…anSimulateYourself

For instance, this applies to TraceDebugger's TDBTracingSimulator.
  • Loading branch information
LinqLover committed Feb 12, 2022
1 parent fdefe10 commit 23ea16c
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*SimulationStudio-Base-testing
canSimulateYourself
"Answer whether it is a valid operation to send #step to a thisContext instance of the receiver class."

^ true
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"fromSimulationContext:" : "ct 3/5/2021 19:41",
"runSimulated:" : "ct 11/14/2021 02:06" },
"instance" : {
"canSimulateYourself" : "ct 2/12/2022 15:12",
"debug" : "ct 12/30/2021 14:28",
"insertEnsure:" : "ct 3/5/2021 19:35",
"insertOn:do:" : "ct 3/5/2021 19:35",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ runSimulated: aBlock contextAtEachStep: anotherBlock

current := self customize: current.

(anotherBlock numArgs = 0
((home canSimulateYourself and: [anotherBlock numArgs = 0])
ifTrue: ["optimized" [resume]]
ifFalse: ["stop execution on time, don't expose simulation details to caller"
[(current sender == ensure and: [current willReturn]) or:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"printOn:" : "ct 12/28/2020 15:49",
"push:" : "ct 12/28/2020 19:07",
"runSimulated:" : "ct 1/10/2021 20:14",
"runSimulated:contextAtEachStep:" : "ct 1/23/2022 01:22",
"runSimulated:contextAtEachStep:" : "ct 2/12/2022 15:48",
"runUntilErrorOrReturnFrom:" : "ct 3/28/2021 12:10",
"send:to:with:lookupIn:" : "ct 12/29/2021 14:52",
"shouldNotImplement:" : "ct 12/28/2020 15:29",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
testing
canContextSimulateItself: aContext do: aBlock
<capability: #canSimulateYourself>

^ nextSimulator
ifNotNil: [nextSimulator canContextSimulateItself: aContext do: aBlock]
ifNil: [aBlock value]
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"allSimulators" : "ct 11/18/2021 22:45",
"basicSimulate:do:" : "ct 11/13/2021 17:07",
"basicSimulate:do:chain:" : "ct 11/13/2021 17:07",
"canContextSimulateItself:do:" : "ct 2/12/2022 15:17",
"context:activateMethod:withArgs:receiver:do:" : "ct 11/13/2021 15:45",
"context:blockReturnConstant:do:" : "ct 11/13/2021 15:19",
"context:callPrimitive:do:" : "ct 11/13/2021 15:40",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
testing
canSimulateYourself

^ simulator canContextSimulateItself: self do: [super canSimulateYourself]
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"blockReturnConstant:" : "ct 11/13/2021 15:13",
"blockReturnTop" : "ct 11/12/2021 17:49",
"callPrimitive:" : "ct 11/13/2021 15:13",
"canSimulateYourself" : "ct 2/12/2022 15:29",
"directedSuperSend:numArgs:" : "ct 11/13/2021 15:13",
"doDup" : "ct 11/12/2021 17:49",
"doPop" : "ct 11/12/2021 17:50",
Expand Down

0 comments on commit 23ea16c

Please sign in to comment.