[Cuis-dev] How to stop exception triggering code in its tracks?

Juan Vuletich juan at cuis.st
Mon Mar 13 15:56:21 PDT 2023


On 3/13/2023 6:05 PM, Alexandre Rousseau via Cuis-dev wrote:
> This helps, thanks. I am at least able to freeze things.
>
> Going further ... executing this in a workspace:
>
>     b := BoxedMorph new.
>     b addMorph: b.
>     b openInHand.
>
>
> the pointer disappears (infinite redraw), I press cmd-. and the 
> debugger (User Interrupt) appears.
>
> Is there any way, at that point, to restore VM state to that point 
> prior to (faulty) code execution (as in, cancel last 2 messages, 
> #addMorph: and #openInHand) ?

Yes. Just close the debugger. The garbage collector will do the rest.

Anyway, just pushed an update that prevents a morph becoming its own 
submorph.

Cheers,

>
>
>
> On Mon, Mar 13, 2023 at 4:20 PM Juan Vuletich <juan at cuis.st 
> <mailto:juan at cuis.st>> wrote:
>
>     On 3/13/2023 1:23 PM, Alexandre Rousseau via Cuis-dev wrote:
>     > I accidentally introduced a bug in my class instance initialization
>     > code (adding a submorph to itself). When instantiating my class,
>     the
>     > debugger appeared but seemed impossible to interact with while the
>     > task bar rapidly filled up with more such debugger representations.
>     >
>     > Unable to deal with this, I killed my cuis environment, losing 30
>     > minutes of work.
>     >
>     > What do you do when faced with runaway exceptions? Is there some
>     > keyboard action once can perform to stop the execution of it?
>
>     It depends on where the exception is raised. If it is in #drawOn:, we
>     already have a recovery mechanism. In some other cases, cmd-. (the
>     interrupt key) let's you recover control. But the whole system is
>     implemented in Smalltalk. There will always be ways to break code
>     in a
>     way that you can't get to a working UI again. As rabbit already said,
>     that's why there are several files where your code is logged, so
>     you can
>     recover it.
>
>     HTH,
>
>     -- 
>     Juan Vuletich
>     cuis.st <http://cuis.st>
>     github.com/jvuletich <http://github.com/jvuletich>
>     researchgate.net/profile/Juan-Vuletich
>     <http://researchgate.net/profile/Juan-Vuletich>
>     independent.academia.edu/JuanVuletich
>     <http://independent.academia.edu/JuanVuletich>
>     patents.justia.com/inventor/juan-manuel-vuletich
>     <http://patents.justia.com/inventor/juan-manuel-vuletich>
>     linkedin.com/in/juan-vuletich-75611b3
>     <http://linkedin.com/in/juan-vuletich-75611b3>
>     twitter.com/JuanVuletich <http://twitter.com/JuanVuletich>
>


-- 
Juan Vuletich
cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
linkedin.com/in/juan-vuletich-75611b3
twitter.com/JuanVuletich

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230313/d6d33140/attachment.htm>


More information about the Cuis-dev mailing list