You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
Assume the code is in
testdbg.jl
and run it in the repl withinclude("testdbg.jl"). The following sequence of commands will not step into
logistic, even though it intuitively should:
n,
s. I would think that this would step over the breakpoint and then into the function. However, the sequence
s,
sdoes step into logistic. It seems that as long as one uses
son **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 the
BreakPointnode in the augmented AST can be skipped over so that only one
s` is required to step into the code.If we change the example a bit to
and store it in a file
testdbg2.jl
and run it in the repl withinclude("testdbg2.jl")
then the only way that I can step into thelogistic
function (or the for-loop) is by always usings
. If I ever usen
then I cannot step intologistic
anymore.The text was updated successfully, but these errors were encountered: