Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
FAQ: Breakpoints
Last updated at 12:57 am UTC on 11 October 2008
Is it possible to set breakpoints or watch conditions in Squeak?

One normally simply inserts "self halt" where one wants a breakpoint. Similarly, for watch points one can use "aTestForWatchpoint ifTrue: [self halt]". This could certainly be set up to be "invisible" but it would make the code generated by a method not match the source code visible in the method.

When dealing with morphic, it is usually better to use "self haltOnce" which, if it gets called more than once, only pops up one debugger. To arm the haltOnce mechanism, run "self setHaltOnce" in a workspace. Most things in morphic get called repeatedly, since there is a global event loop. This can result in a crashing image by putting it in a loop like this accidentally, resulting in infinite debugger windows.

See also Debugger