[Newbies] whats the difference between over and through
ron at usmedrec.com
Tue May 17 21:06:41 UTC 2016
Nice description Herbert! That reminded me of one extra thing. It's kind of hidden but very useful.
If you need to get out of a loop but don't want to restart and add a halt, you can click on some place in your code then select "Run To Here" from the pop up menu (right click on windows).
That will continue your code until it gets to where the cursor is currently located and resume debugging from that location.
That's pretty useful too.
All the best,
> From: Herbert König
> Sent: Tuesday, May 17, 2016 4:33 PM
> Hi Joe,
> a practical tip if you debug loops:
> myCollection collect: [:each| "You need 'through' to get into the loop"
> self doThis. "Through or over are ok here"
> self doThatWhichTakesLongToRun. "use over to go over this long running
> somethingElse doMore "here you need to press through again or you'll
> learn about the inner workings of collect :-))"]
> I want to mention three things:
> 1- if you are inside a loop with no other block inside you can always
> continue with pressing 'Through'. This will then go through the next iteration
> of the loop but step over the method sends inside the loop.
> Methods inside the loop seem to take much longer if you go over them via
> 'through' than if you go over them via 'over'. Especially on slow hardware.
> 2- if by accident you press 'over' while debugging the last send inside a loop
> you get to the outer context of your loop which is very confusing at the
> beginning. To get back into your loop you have to step 'into' the block you'll
> see there.
> 3- if you've seen enough after being 'through' three iterations of of a
> 1000 iteration loop you continue one level above (top pane of the
> debugger) and debug 'over' that loop.
> Most important : experiment.
> I have no Squeak at hand so take the above just as a coarse description on
> what you may encounter on your debugging journey.
> I usually debug my code into life and I still manage to press the wrong
> buttons while debugging :-))
> Am 17.05.2016 um 19:36 schrieb Ron Teitelbaum:
> > Hi Joe,
> > This is a very good question. It's something that if you been using the
> debugger for a long time comes naturally but when you are new it seems
> > Take this code for example:
> > | lock |
> > lock := Mutex new.
> > lock critical: [Transcript show: 'I am here']
> > debug this code and play with the different options to see how this works.
> In general there are a number of times where what you want to debug is
> inside a block. Getting into that block can be a real pain. In many cases you
> really just want to say take me through this outer code and into that block
> so I can debug what is inside it. (in this case Transcript show: )
> > "Over" will skip it and "Into" will take you down the rabbit hole of code
> that surrounds it.
> > In this case try debugging that code using the different options and see
> how much easier getting inside that block is when you use Through.
> > I think the accepted description is:
> > Through: if the debugger is going to execute a block, with this button you
> can step though this block.
> > and it makes sense when you think I want to step through what is inside
> the block. "Take me through the inside of this block".
> > Does that make sense?
> > All the best,
> > Ron Teitelbaum
> >> -----Original Message-----
> >> From: beginners-bounces at lists.squeakfoundation.org [mailto:beginners-
> >> bounces at lists.squeakfoundation.org] On Behalf Of Joseph Alotta
> >> Sent: Tuesday, May 17, 2016 1:07 PM
> >> To: beginners at lists.squeakfoundation.org
> >> Subject: [Newbies] whats the difference between over and through
> >> Greetings,
> >> What’s the difference between over and through in the debugger?
> >> Is there something that goes to the next line of code?
> >> Sincerely,
> >> Joe.
> >> _______________________________________________
> >> Beginners mailing list
> >> Beginners at lists.squeakfoundation.org
> >> http://lists.squeakfoundation.org/mailman/listinfo/beginners
> > _______________________________________________
> > Beginners mailing list
> > Beginners at lists.squeakfoundation.org
> > http://lists.squeakfoundation.org/mailman/listinfo/beginners
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
More information about the Beginners