From 566f4ca2f7446cc86c743175e0012d0e3b0f197f Mon Sep 17 00:00:00 2001 From: adri09070 Date: Wed, 6 Jul 2022 17:16:30 +0200 Subject: [PATCH 1/4] fixing skip so that it steps method nodes --- Sindarin-Tests/SindarinDebuggerTest.class.st | 26 ++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Sindarin-Tests/SindarinDebuggerTest.class.st b/Sindarin-Tests/SindarinDebuggerTest.class.st index f376524..6eea41a 100644 --- a/Sindarin-Tests/SindarinDebuggerTest.class.st +++ b/Sindarin-Tests/SindarinDebuggerTest.class.st @@ -572,6 +572,32 @@ SindarinDebuggerTest >> testSkip [ self assert: p equals: nil ] +{ #category : #tests } +SindarinDebuggerTest >> testSkipStepsMethodNodes [ + + | scdbg realExecNode realExecPc realTopStack | + scdbg := SindarinDebugger debug: [ + self helperMethodWithBlockWithNoReturn ]. + + scdbg step. + scdbg stepOver. + + realExecNode := scdbg node. + realExecPc := scdbg pc. + realTopStack := scdbg topStack. + + scdbg := SindarinDebugger debug: [ + self helperMethodWithBlockWithNoReturn ]. + + scdbg + step; + skip. + + self assert: scdbg node identicalTo: realExecNode. + self assert: scdbg pc identicalTo: realExecPc. + self assert: scdbg topStack equals: realTopStack +] + { #category : #'tests - skipping' } SindarinDebuggerTest >> testSkipThroughNode [ | dbg realExecPC realValueOfA targetExecNode realExecTopStack nodeAfterSkipThrough | From 98f20a3a26ac1fad2bc0828b14b9489475d51534 Mon Sep 17 00:00:00 2001 From: adri09070 Date: Wed, 6 Jul 2022 17:16:42 +0200 Subject: [PATCH 2/4] fixing skip so that it steps method nodes From fc79f10493ab9996a5d1edec04108f6de9323e25 Mon Sep 17 00:00:00 2001 From: adri09070 Date: Fri, 8 Jul 2022 16:00:08 +0200 Subject: [PATCH 3/4] adding helper I forgot to commit for tests --- Sindarin/SindarinDebugger.class.st | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Sindarin/SindarinDebugger.class.st b/Sindarin/SindarinDebugger.class.st index 545f32f..ccbe758 100644 --- a/Sindarin/SindarinDebugger.class.st +++ b/Sindarin/SindarinDebugger.class.st @@ -527,9 +527,11 @@ SindarinDebugger >> sindarinSession: aSindarinDebugSession [ { #category : #'stepping - skip' } SindarinDebugger >> skip [ + "If it is a message send or assignment, skips the execution of the current instruction, and puts nil on the execution stack." - self node isAssignment - ifTrue: [ ^ self skipAssignmentNodeCompletely ]. + + self node isAssignment ifTrue: [ ^ self skipAssignmentNodeCompletely ]. + self node isMethod ifTrue: [ ^ self step ]. self skipWith: nil ] From b38a02ffe66b51f68a0a3ba2ffda913125b518aa Mon Sep 17 00:00:00 2001 From: adri09070 Date: Fri, 8 Jul 2022 16:00:20 +0200 Subject: [PATCH 4/4] classifying method --- Sindarin-Tests/SindarinDebuggerTest.class.st | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Sindarin-Tests/SindarinDebuggerTest.class.st b/Sindarin-Tests/SindarinDebuggerTest.class.st index 6eea41a..6ebdf4b 100644 --- a/Sindarin-Tests/SindarinDebuggerTest.class.st +++ b/Sindarin-Tests/SindarinDebuggerTest.class.st @@ -230,6 +230,15 @@ SindarinDebuggerTest >> helperMethodReturnWithHalt [ ^ a + 1 ] +{ #category : #helpers } +SindarinDebuggerTest >> helperMethodWithBlockWithNoReturn [ + + | block a | + block := [ a := 1 ]. + block value. + ^ 43 +] + { #category : #running } SindarinDebuggerTest >> runCaseManaged [ ^ self runCase