Skip to content

When we skip a message, it only skips one bytes but certain bytecodes are made up of more than one byte #34

@adri09070

Description

@adri09070

When the skip command skips a send byte code, it increments the pc of one byte to skip the message send.

SindarinDebugger>>#skipMessageWith: replacementValue
self node arguments do: [ :arg | self context pop ].	"Pop the arguments of the message send from the context's value stack"
	"Pop the receiver from the context's value stack"
	self context pop.
	"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.
	"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

However, some send messages bytecodes are made up of 2 bytes (e.g: send messages with super):

image

So, it should increment the pc of the number of bytes in the byte code standing for the message send

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