whats the difference between over and through

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

whats the difference between over and through

Joseph Alotta
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
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
bpi
Reply | Threaded
Open this post in threaded view
|

Re: whats the difference between over and through

bpi
Hi,

The difference is only relevant for statements with blocks. Over executes the next message send and then stops. Over does not enter block, though. Through does.

Cheers,
Bernhard

> Am 17.05.2016 um 19:06 schrieb Joseph Alotta <[hidden email]>:
>
> 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
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

RE: whats the difference between over and through

Ron Teitelbaum
In reply to this post by Joseph Alotta
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 strange.

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: [hidden email] [mailto:beginners-
> [hidden email]] On Behalf Of Joseph Alotta
> Sent: Tuesday, May 17, 2016 1:07 PM
> To: [hidden email]
> 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
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: whats the difference between over and through

Herbert König
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 method"

     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 :-))


Cheers,


Herbert

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 strange.
>
> 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: [hidden email] [mailto:beginners-
>> [hidden email]] On Behalf Of Joseph Alotta
>> Sent: Tuesday, May 17, 2016 1:07 PM
>> To: [hidden email]
>> 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
>> [hidden email]
>> http://lists.squeakfoundation.org/mailman/listinfo/beginners
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

RE: whats the difference between over and through

Ron Teitelbaum
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,

Ron

> 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
> method"
>
>      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 :-))
>
>
> Cheers,
>
>
> Herbert
>
> 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
> strange.
> >
> > 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: [hidden email] [mailto:beginners-
> >> [hidden email]] On Behalf Of Joseph Alotta
> >> Sent: Tuesday, May 17, 2016 1:07 PM
> >> To: [hidden email]
> >> 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
> >> [hidden email]
> >> http://lists.squeakfoundation.org/mailman/listinfo/beginners
> > _______________________________________________
> > Beginners mailing list
> > [hidden email]
> > http://lists.squeakfoundation.org/mailman/listinfo/beginners
>
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: whats the difference between over and through

Joseph Alotta
Thanks for all the help.  Thanks for the sample code also.  My debugging is improving.



> On May 17, 2016, at 3:30 PM, Ron Teitelbaum [via Smalltalk] <[hidden email]> wrote:
>
> 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,
>
> Ron
>
> > 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
> > method"
> >
> >      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 :-))
> >
> >
> > Cheers,
> >
> >
> > Herbert
> >
> > 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
> > strange.
> > >
> > > 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: [hidden email] [mailto:beginners-
> > >> [hidden email]] On Behalf Of Joseph Alotta
> > >> Sent: Tuesday, May 17, 2016 1:07 PM
> > >> To: [hidden email]
> > >> 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
> > >> [hidden email]
> > >> http://lists.squeakfoundation.org/mailman/listinfo/beginners
> > > _______________________________________________
> > > Beginners mailing list
> > > [hidden email]
> > > http://lists.squeakfoundation.org/mailman/listinfo/beginners
> >
> > _______________________________________________
> > Beginners mailing list
> > [hidden email]
> > http://lists.squeakfoundation.org/mailman/listinfo/beginners
>
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>
>
> If you reply to this email, your message will be added to the discussion below:
> http://forum.world.st/whats-the-difference-between-over-and-through-tp4895443p4895522.html
> To start a new topic under Squeak - Beginners, email [hidden email]
> To unsubscribe from Squeak - Beginners, click here.
> NAML