Correction of stepToReturn command to be able to step to non-local returns. #22
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #21
In
SindarinDebugger, thestepToReturncommand didn't step to returns in blocks, as its implementation was usingstepOver.I've tried an implementation that uses
stepThrough, which indeed fixed the problem, but that is problematic asstepThroughactually 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 asstepIntostops 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, westepIntoto enter the block.Furthermore,
SindarinDebugger >> hasSignalledUnhandledExceptionhas been modifed as it actually has never worked before to stop on exception signals. Indeed, theSindarin>>testStepToReturnWithExceptionwas stopping correctly "by chance" on theexception signal because the current context, which is the context of the exception, returned.Now,
SindarinDebugger >> hasSignalledUnhandledExceptionactually causesstepToreturnto stop on exception signals.