[squeak-dev] stepping over non local return in a protected block
nicolas.cellier.aka.nice at gmail.com
Thu May 13 13:36:54 UTC 2021
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.
> To prove this try changing #aboutToReturn and the BlockCannotReturn error is
> #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