Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions Sindarin-Tests/SindarinDebuggerTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,32 @@ SindarinDebuggerTest >> testSkipDoesNotSkipReturn [
self should: [ scdbg skip ] raise: SindarinSkippingReturnWarning
]

{ #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 |
Expand Down
3 changes: 2 additions & 1 deletion Sindarin/SindarinDebugger.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -531,11 +531,12 @@ SindarinDebugger >> sindarinSession: aSindarinDebugSession [

{ #category : #'stepping - skip' }
SindarinDebugger >> skip [

| nextBytecode |
"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 isMessage ifTrue: [ ^ self skipMessageNode ].
self node isMethod ifTrue: [ ^ self step ].
nextBytecode := self currentBytecode detect: [ :each |
each offset = self pc ].
(self node isReturn or: [
Expand Down