[squeak-dev] stepping over non local return in a protected block

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Thu May 13 13:36:54 UTC 2021


Hi Jaromir,
good find!
See https://source.squeak.org/inbox/Kernel-nice.1407.diff
I based it on your latest inbox contribution, because I don't know if
this could be decoupled...

Le mer. 12 mai 2021 à 20:48, Jaromir Matas <m at jaromir.net> a écrit :
>
> Hi Nicolas, Christoph, all
>
> > When debugging things like this:
> >
> >   [^2] ensure: [Transcript cr; show: 'done'].
> >
> > if we step into the protected block [^2], then step over ^2, we
> > incorrectly get a BlockCannotReturn.
>
> Found a bug inside the debugger causing this problem: #stepOver uses
> #runUntilErrorOrReturnFrom: which inserts an ensure context when started.
> The problem happens when the debugger simulates #aboutToReturn:through: --
> before it starts executing it via #runUntilErrorOrReturnFrom this method
> inserts its ensure context between #aboutToReturn:through:firstUnwindContext
> and its firstUnwindContext argument! This means the inserted context will be
> skipped during execution and that's the whole problem :)
>
> The situation is captured on the enclosed screenshot.
> Screenshot_2021-05-12_202833.png
> <http://forum.world.st/file/t372955/Screenshot_2021-05-12_202833.png>
>
> To prove this try changing #aboutToReturn and the BlockCannotReturn error is
> gone:
>
> #aboutToReturn: result through: firstUnwindContext
>         "Called from VM when an unwindBlock is found between self and its home.
>          Return to home's sender, executing unwind blocks on the way."
>
>         self methodReturnContext return: result
>
> I'm not sure how to fix it but a debugger pro should figure it out way
> faster than me :)
>
>
>
>
>
> -----
> ^[^ Jaromir
> --
> Sent from: http://forum.world.st/Squeak-Dev-f45488.html
>


More information about the Squeak-dev mailing list