[Cuis-dev] How to stop exception triggering code in its tracks?
Alexandre Rousseau
yalexr at gmail.com
Mon Mar 13 14:05:19 PDT 2023
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) ?
On Mon, Mar 13, 2023 at 4:20 PM Juan Vuletich <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
> 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/a313a7fe/attachment.htm>
More information about the Cuis-dev
mailing list