diff --git a/src/Sindarin-Tests/SindarinDebuggerTest.class.st b/src/Sindarin-Tests/SindarinDebuggerTest.class.st index 6628f7e..0774bd5 100644 --- a/src/Sindarin-Tests/SindarinDebuggerTest.class.st +++ b/src/Sindarin-Tests/SindarinDebuggerTest.class.st @@ -1258,7 +1258,7 @@ SindarinDebuggerTest >> testNode [ self assert: node selector equals: #asInteger ] -{ #category : 'tests' } +{ #category : 'tests - pc' } SindarinDebuggerTest >> testPc [ | dbg | dbg := SindarinDebugger diff --git a/src/Sindarin/SindarinDebugger.class.st b/src/Sindarin/SindarinDebugger.class.st index a3a5733..3e407a2 100644 --- a/src/Sindarin/SindarinDebugger.class.st +++ b/src/Sindarin/SindarinDebugger.class.st @@ -42,22 +42,17 @@ SindarinDebugger >> assignmentVariableName [ ^ self node variable name ] -{ #category : 'astAndAstMapping' } -SindarinDebugger >> bestNodeFor: anInterval [ - - ^ self node methodNode bestNodeFor: anInterval -] - { #category : 'ast manipulation' } SindarinDebugger >> canStillExecute: aProgramNode [ "returns true if the last pc mapped to aProgramNode is greater than `self pc` in the right context " - | lastPcForNode rightContext | + | lastPcForNode rightContext outerContext | rightContext := self context. + outerContext := rightContext outerContext ifNil: [ rightContext ]. [ - rightContext == rightContext outerMostContext or: [ - rightContext method ast allChildren identityIncludes: aProgramNode ] ] + rightContext == outerContext or: [ + rightContext method ast allChildren identityIncludes: aProgramNode ] ] whileFalse: [ rightContext := rightContext sender ]. lastPcForNode := (rightContext method ast lastPcForNode: aProgramNode) @@ -609,6 +604,12 @@ SindarinDebugger >> stepUntil: aBlock [ aBlock whileFalse: [ self step ] ] +{ #category : 'astAndAstMapping' } +SindarinDebugger >> targetNodeFor: anInterval [ + + ^ self node methodNode bestNodeFor: anInterval +] + { #category : 'API - changes' } SindarinDebugger >> tryMoveToNodeInHomeContext: aNode [ "Moves to node aNode if aNode is in the lexical context. Otherwise, the program state goes back to how it was before trying and signals an error as the node is not in AST" diff --git a/src/Sindarin/TSindarin.trait.st b/src/Sindarin/TSindarin.trait.st index 37b3e71..1c2a6db 100644 --- a/src/Sindarin/TSindarin.trait.st +++ b/src/Sindarin/TSindarin.trait.st @@ -195,7 +195,7 @@ TSindarin >> outerMostContextOf: aContext [ oldContext := nil. [currentContext ~= oldContext] whileTrue: [ oldContext := currentContext. - currentContext := currentContext outerMostContext ]. + currentContext := currentContext outerContext ifNil:[currentContext]]. ^ currentContext ]