is there a fix so that cmd+. on mac open a debugger when we get a loop?

Lex Spoon lex at cc.gatech.edu
Tue Feb 15 04:07:00 UTC 2005


Ned Konz <ned at squeakland.org> wrote:
> The problem is obviously that he's got infinite recursion, calling fullBounds 
> from within something called by adjustLayoutBounds.

Eww, nasty.


> 
> I'd suggested in the past that we do one or more of:
> 
> * When we get an interrupt we check for recursion, and if it's in a Morph's 
> code then mark that morph (or perhaps all the morphs of that class) as having 
> errors (if the recursion is in a drawing method) or just delete them and 
> stick them in the trash can or somewhere if the error is in somewhere else 
> (as it is here).
> 
> * If we get an interrupt while we're trying to open a debugger (and failing, 
> presumably) then we drop into MVC and open up a debugger there.

This does happen for the specific cases of drawing and stepping.  If
there's a drawing error, the morph draws as red with a big X on it.  If
there's a stepping error, then the morph stops stepping.   But, there is
obviously nothing to help with errors in other 

Your general idea is great.  When implementing it, keep in mind that if
the morph is really wedged, maybe #delete won't even work!  So that's
another case when you might jump to MVC.

Also, you might first try jumping to a different Morphic project, before
going to the draconian step of going to MVC.  Most likely, leaving the
project is enough to let the image settle down to a sane state that you
can operate on.  Along these lines, it would be better to try MVC,
before going to the *really* draconian step of giving them the emergency
evaluator.  This means there is a list of things to try that are
increasingly depressing: delete the morph, leave the project, go to MVC,
then go to command line.  

Finally, note that there is a depressingly easy way to create a really
screwed-up morph: make a subclass of Morph, override #initialize, and
forget to call "super initialize".  Bam.  This bothers me a lot; it
*really* screws the system up, and thus it should not be so easy to do.

-Lex


PS -- another idea floating around, that we should really implement some
day, is to have a warning if the stack gets humongous....



More information about the Squeak-dev mailing list