[Newbies] Re: Breakpoints in Squeak's debugger

Ron Teitelbaum Ron at USMedRec.com
Tue May 16 13:16:12 UTC 2006


Rich and Klaus,

I looked at toggle break on entry and I don't find that to be terribly
useful.  There are a few problems that I saw.  First don't try to add a
break to new.  Second it uses the compiled version of the bytecodes, which
can make the method very hard to read.  Adding and removing a halt seems to
me to be easier and allows for greater flexibility.  Just add the world halt
in your code just about anywhere after an object, or add the line: self
halt. where you want to break.  For example: 

Person>calcAge
	"return to the sender the age in years of this person"
	^(Date today - self halt birthdate) // 365.25

This will halt in the message chain right before sending the method
birthdate.  Then you can use the debugger to find out what birthdate does.
Some people have argued that you don't really know that halt returns "self"
so you should add a semicolon to the halt to make sure you get back to the
right object when the halt returns.  So it should read instead 

... self halt; birthdate ...  since halt does return self this to me is a
style question an I'll leave it up to you.

Also see my earlier post on alternate halts.

http://lists.squeakfoundation.org/pipermail/beginners/2006-May/000121.html 

Just remember to remove the halts later or consider adding a halt exception
handler if you have a production application.  The handler can simply skip
the halts.

If you have any questions feel free!

Happy Coding!!

Ron Teitelbaum
President / Principal Software Engineer
US Medical Record Specialists
Ron at USMedRec.com 

> -----Original Message-----
> From: Rich
> Sent: Tuesday, May 16, 2006 8:28 AM
> Would that be "Toogle break on entry?"
> 
> On 5/16/06, Klaus D. Witzel <klaus.witzel at cobss.com> wrote:
> > Hi Chad & Rich,
> >
> > in a browser select a method and do a right click, breakpoint is
> mentioned
> > in that contect menu.
> >
> > /Klaus
> >
> > On Tue, 16 May 2006 05:19:25 +0200, Chad Nantais
> > <chad at clearwaterassociates.ca> wrote:
> >
> > > Drop a 'self halt' where you want a breakpoint.  That will launch the
> > > debugger.
> > >
> > > Hope this helps.
> > >
> > > Chad
> > >
> > > On 5/15/06, Rich <rjseagraves at gmail.com> wrote:
> > >> I've been playing around with Squeak's debugger, and I was wondering
> > >> how you set breakpoints (or if you can set breakpoints)?  Thanks you.
> > >>
> > >> -Rich




More information about the Beginners mailing list