Well, we got a real Debugger Model which says:

DebugSession>>#stepInto: aContext
        "Send the selected message in selectedContext, and take control in 
        the method invoked to allow further step or send."

DebugSession>>#stepOver: aContext
        "Send the selected message in selectedContext, and regain control 
        after the invoked method returns."

DebugSession>>#stepThrough: aContext
        "Send messages until you return to selectedContext.
         Used to step into a block in the method."

I must admit that Over vs Through confuses the hell out of me, but playing with 
it, this is one feature I should have learned to use much earlier! 

My interpretation now is: Through is just like Over but it will stop again 
whenever the context becomes the current one while doing the Over. 

And you are right: it is very useful when dealing with iteration blocks, since 
each time inside one of the blocks used as arguments, the debugger will stop, 
and you can trace the execution.

Try Debug It on the following expression:

#(1 2 3 4 5) sum.

Start by stepping Into the #sum, next step Over the first assignment (sample := 
self anyOne) and then use Through for the #inject:into: iteration and observe 
how you get control back each time through (aha) the block [:accum :each | 
accum + each].

Pretty cool actually.

> On 4 Feb 2017, at 17:10, Ben Coman <b...@openinworld.com> wrote:
> 
>>> On Feb 3, 2017, at 13:29, Hilaire <hila...@drgeo.eu> wrote:
>>> 
>>> what are the differences between 'over' and 'through' buttons in the
>>> debugger.
> 
> On Sat, Feb 4, 2017 at 8:09 AM, John Pfersich <jpfers...@gmail.com> wrote:
>> 
>> The over button means step over the message highlighted, the through button 
>> means step into the message highlighted and single step through the 
>> statements in the message.
> 
> I'm not sure if I am correct, but more than stepping over/through messages,
> I normally think about it as how blocks are handled.
> 
> Over is step over a block.
> Through is step through a block.
> 
> Try debugging this, purely with Over and then purely with Through...
>    self inform: '1'.
>    #(2 3 4) do: [:n| self inform: n printString ].
>    self inform: '5'.
> 
> However its not completely about blocks,  since Over versus Through
> has little difference on debugging this...
>    self inform: '1'.
>    2 to: 4 do: [:n| self inform: n printString ].
>    self inform: '5'.
> 
> So it seems it affects a certain subset of messages,
> which is at least the usual enumeration messages...
>   #do: #collect: #select: #detect:
> but I don't know what the comprehensive list is.
> 
> So maybe that it another way to define the difference
> Over steps over enumeration of a block
> Through step through enumeration of a block
> 
> or...
> Over steps of iteration of a block
> Through step through iteration of a block
> 
> I'm not sure which is more correct.
> cheers -ben
> 


Reply via email to