Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to step into user-defined functions sometimes #46

Open
nfoti opened this issue Jul 3, 2013 · 1 comment
Open

Unable to step into user-defined functions sometimes #46

nfoti opened this issue Jul 3, 2013 · 1 comment

Comments

@nfoti
Copy link
Contributor

nfoti commented Jul 3, 2013

Sometimes I am not able to step into a function I've defined. I'm not sure if this is a bug or a limitation of the current package.

Here's a small example.

@debug begin

function logistic(x)
  return 1./(1+exp(-x))
end

function f()
  s = 0.
  for i in 1:10
    @bp
    tmp = logistic(rand())
    s += tmp
  end
end

end # end debug

f()

Assume the code is in testdbg.jl and run it in the repl with include("testdbg.jl"). The following sequence of commands will not step intologistic, even though it intuitively should:n,s. I would think that this would step over the breakpoint and then into the function. However, the sequences,sdoes step into logistic. It seems that as long as one usesson **both** the@bpand the line to step into then we will enter the function. Maybe the@bpsyntax should be changed to allow code on the same line, e.g.@bp logistic(rand())and theBreakPointnode in the augmented AST can be skipped over so that only ones` is required to step into the code.

If we change the example a bit to

using Debug

@debug begin

function logistic(x)
  return 1./(1+exp(-x))
end

function f()
  @bp
  s = 0.
  for i in 1:10
    tmp = logistic(rand())
    s += tmp
  end
end

end # end debug

f()

and store it in a file testdbg2.jl and run it in the repl with include("testdbg2.jl") then the only way that I can step into the logistic function (or the for-loop) is by always using s. If I ever use n then I cannot step into logistic anymore.

@toivoh
Copy link
Owner

toivoh commented Nov 9, 2013

I will see if I will get some time to look into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants