Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
ffb94c2
fixing skipAssignment
adri09070 Jun 2, 2022
c350dd9
Adding a test for skipAssignment method, to check that a replacement …
adri09070 Jun 2, 2022
7325064
Fixing skipMessage so that it leaves the receiver on the stack instea…
adri09070 Jul 5, 2022
d4954f5
Fixing skip so that it increments the pc by the number of bytes in th…
adri09070 Jul 5, 2022
502e2bc
adding a method I forgot to commit
adri09070 Jul 5, 2022
dfd5179
fixing skip + skipUpTo command so that it stops on return nodes and i…
adri09070 Jul 6, 2022
566f4ca
fixing skip so that it steps method nodes
adri09070 Jul 6, 2022
98f20a3
fixing skip so that it steps method nodes
adri09070 Jul 6, 2022
08a83a9
calling skipMessage in skip ( forgot to commit )
adri09070 Jul 8, 2022
2d56cfb
Fixing a test for skipMessage
adri09070 Jul 8, 2022
4148bad
calling skipMessage in skip + fixing test + reverting the suppressio…
adri09070 Jul 8, 2022
a916534
calling skipReturnNode in skip + helperMethod (forgot to commit them)
adri09070 Jul 8, 2022
fc79f10
adding helper I forgot to commit for tests
adri09070 Jul 8, 2022
b38a02f
classifying method
adri09070 Jul 8, 2022
14fe2fd
fixing skip so that it skips block creations
adri09070 Jul 11, 2022
ac665c0
Merge pull request #24 from adri09070/23-Skip-command-causes-a-missin…
StevenCostiou Jul 19, 2022
9934ec8
Merge pull request #33 from adri09070/31-fixing-skipping-message-that…
StevenCostiou Jul 19, 2022
7ed210b
Merge branch 'master' into 34-When-we-skip-a-message-it-only-skips-on…
adri09070 Jul 19, 2022
4f274c8
categorizing method
adri09070 Jul 19, 2022
274f823
Merge pull request #35 from adri09070/34-When-we-skip-a-message-it-on…
StevenCostiou Jul 19, 2022
df3de15
Merge branch 'master' into 37-Skip-doesnt-skip-returns
adri09070 Jul 19, 2022
561b05e
Merge pull request #40 from adri09070/37-Skip-doesnt-skip-returns
StevenCostiou Jul 19, 2022
286c47e
Merge branch 'master' into 39-Skip-doesnt-skip-method-nodes
adri09070 Jul 19, 2022
3d81c10
Merge pull request #41 from adri09070/39-Skip-doesnt-skip-method-nodes
StevenCostiou Jul 26, 2022
ea21e7e
Merge branch 'master' into 38-Skip-command-doesnt-skip-block-creation…
adri09070 Jul 26, 2022
8aa2b98
classifying method
adri09070 Jul 26, 2022
fa48eb6
Merge pull request #46 from adri09070/38-Skip-command-doesnt-skip-blo…
StevenCostiou Jul 26, 2022
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
51 changes: 35 additions & 16 deletions Sindarin-Tests/SindarinDebuggerTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -568,22 +568,7 @@ SindarinDebuggerTest >> testSkip [
self assert: p equals: Point
]

{ #category : #tests }
SindarinDebuggerTest >> testSkipSkipsMessagesByPuttingReceiverOnStack [

| a scdbg |
a := 1.
scdbg := SindarinDebugger
debug: [ a := a + 2 ].
self assert: a equals: 1.

scdbg skip.
scdbg step.

self assert: a equals: 1
]

{ #category : #tests }
{ #category : #'tests - skipping' }
SindarinDebuggerTest >> testSkipAssignmentWithStoreIntoBytecodePushesReplacementValueButNotWithPopIntoBytecode [

| a b dbg aFormerValue bFormerValue |
Expand Down Expand Up @@ -612,6 +597,40 @@ SindarinDebuggerTest >> testSkipAssignmentWithStoreIntoBytecodePushesReplacement
self assert: a equals: aFormerValue
]

{ #category : #tests }
SindarinDebuggerTest >> testSkipSkipsMessagesByPuttingReceiverOnStack [

| a scdbg |
a := 1.
scdbg := SindarinDebugger
debug: [ a := a + 2 ].
self assert: a equals: 1.

scdbg skip.
scdbg step.

self assert: a equals: 1
]

{ #category : #tests }
SindarinDebuggerTest >> testSkipSkipsSuperSendBytecodesCorrectly [

| a scdbg oldValueOfA negatedContext |
a := ScaledDecimal newFromNumber: 3 scale: 2.
scdbg := SindarinDebugger debug: [ a := a negated ].
oldValueOfA := a.

scdbg
step;
stepOver;
skip.
negatedContext := scdbg context.
scdbg stepUntil: [ scdbg context == negatedContext ].
scdbg stepOver.

self assert: a equals: oldValueOfA
]

{ #category : #'tests - skipping' }
SindarinDebuggerTest >> testSkipThroughNode [
| dbg realExecPC realValueOfA targetExecNode realExecTopStack nodeAfterSkipThrough |
Expand Down
11 changes: 9 additions & 2 deletions Sindarin/SindarinDebugger.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,13 @@ SindarinDebugger >> method [
^ self context method
]

{ #category : #'accessing - bytes' }
SindarinDebugger >> nextBytecode [

^ self currentBytecode detect: [ :each |
each offset = self context pc ]
]

{ #category : #astAndAstMapping }
SindarinDebugger >> node [
"Returns the AST node about to be executed by the top context of the execution"
Expand Down Expand Up @@ -572,7 +579,7 @@ SindarinDebugger >> skipMessageNode [
self node arguments do: [ :arg | self context pop ]. "Pop the arguments of the message send from the context's value stack"

"Increase the pc to go over the message send"
self context pc: self context pc + 1.
self context pc: self context pc + self nextBytecode bytes size.
"Execute bytecodes the debugger usually executes without stopping the execution (for example popping the return value of the just executed message send if it is not used afterwards)"
self debugSession stepToFirstInterestingBytecodeIn:
self debugSession interruptedProcess
Expand All @@ -587,7 +594,7 @@ SindarinDebugger >> skipMessageNodeWith: replacementValue [
"Push the replacement value on the context's value stack, to simulate that the message send happened and returned nil"
self context push: replacementValue.
"Increase the pc to go over the message send"
self context pc: self context pc + 1.
self context pc: self context pc + self nextBytecode bytes size.
"Execute bytecodes the debugger usually executes without stopping the execution (for example popping the return value of the just executed message send if it is not used afterwards)"
self debugSession stepToFirstInterestingBytecodeIn:
self debugSession interruptedProcess
Expand Down