Skip to content

Skip command causes a missing value on the stack, when storeInto bytecodes are involved #23

@adri09070

Description

@adri09070

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions