Debug.jl icon indicating copy to clipboard operation
Debug.jl copied to clipboard

Using `n` on a for-loop skips over the loop

Open nfoti opened this issue 12 years ago • 3 comments

Consider the following code that is assumed to be correctly marked for debugging

function f()
  @bp
   for i in 1:10
      t = i.^2
   end
end

If the debugger is trapped at the for i in 1:10 line I issue the command n then the whole for-loop is executed. This is contrary to every debugger I've used and is also inconsistent with the behavior of other types of blocks in julia. For example, using n on an if statement causes the debugger to enter the block.

nfoti avatar Jul 03 '13 16:07 nfoti

use 's' instead. according to the documentation "'n' : step over any enclosed scope". a for loop in julia is a scope.

bjarthur avatar Sep 25 '13 12:09 bjarthur

I was suggesting that 'n' be made consistent with most every other debugger and step into scopes, just not functions.

On Wed, Sep 25, 2013 at 5:29 AM, Ben Arthur [email protected]:

use 's' instead. according to the documentation "'n' : step over any enclosed scope". a for loop in julia is a scope.

— Reply to this email directly or view it on GitHubhttps://github.com/toivoh/Debug.jl/issues/47#issuecomment-25081823 .

nfoti avatar Sep 25 '13 16:09 nfoti

I agree that it could be useful to have a step over command that behaves more like most debuggers. Not sure how much work it might be. I will see if I eventually get some time to look at this.

toivoh avatar Nov 09 '13 09:11 toivoh