The current version of skipAssignment systematically pops the value that was going to be assigned, which is right.
However, when the bytecode involved in the assignment is a storeIntoXXX bytecode instead of a `popIntoXXX bytecode, the assignment value is supposed to stay as this is considered as the result of the assignment. These bytecodes are used in the case of an assignment whose result is used in the next instruction, for example:
an assignment whose result is assigned to another variable
an assignment made in a block if it is the last instruction of the block.
In this case, skipAssignment pops the value, which causes an undefined behaviour, as all values on the stack are shifted as one more value was expected.
SindarinDebugger >> skipAssignmentNodeCompletely
self context pop.
"Pop the value to be assigned"
"Increase the pc to go over the assignment"
self context pc: (self context pc) + (self currentBytecode detect: [:each | each offset = self context pc ]) 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
To fix this, we should push a replacement value on the stack if the involved bytecode is a storeInto bytecode
The current version of skipAssignment systematically pops the value that was going to be assigned, which is right.
However, when the bytecode involved in the assignment is a
storeIntoXXX
bytecode instead of a `popIntoXXX bytecode, the assignment value is supposed to stay as this is considered as the result of the assignment. These bytecodes are used in the case of an assignment whose result is used in the next instruction, for example:In this case,
skipAssignment
pops the value, which causes an undefined behaviour, as all values on the stack are shifted as one more value was expected.To fix this, we should push a replacement value on the stack if the involved bytecode is a
storeInto
bytecode