Skip to content

Conversation

@adri09070
Copy link
Collaborator

@adri09070 adri09070 commented May 25, 2022

Fixes #21
In SindarinDebugger, the stepToReturn command didn't step to returns in blocks, as its implementation was using stepOver.

I've tried an implementation that uses stepThrough, which indeed fixed the problem, but that is problematic as stepThrough actually steps beyond exception signals if these exceptions are resumable.

I've also tried an implementation that uses stepInto, which also fixed the problem, but that is problematic as stepInto stops on halts, which is not the expected behaviour.

Now, the implementation I've done matches all 3 goals:
While a return hasn't been reached in the lexical context or an exception hasn't been signaled, we stepOver (to step on exceptions but not halts) except if we are on a message node that has, as a receiver or as an argument, a block that is defined in the same lexical context in which we step to return. In the latter case, we stepInto to enter the block.

Furthermore, SindarinDebugger >> hasSignalledUnhandledException has been modifed as it actually has never worked before to stop on exception signals. Indeed, the Sindarin>>testStepToReturnWithException was stopping correctly "by chance" on theexception signal because the current context, which is the context of the exception, returned.

Now, SindarinDebugger >> hasSignalledUnhandledException actually causes stepToreturn to stop on exception signals.

@adri09070 adri09070 marked this pull request as ready for review May 25, 2022 12:24
@StevenCostiou StevenCostiou merged commit fa678e8 into pharo-spec:master May 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stepToReturn command doesn't step to non-local returns (in block)

2 participants