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

[BUG] Breakpoint fails if it's the first encountered statement #273

Closed
timholy opened this issue Mar 28, 2019 · 2 comments
Closed

[BUG] Breakpoint fails if it's the first encountered statement #273

timholy opened this issue Mar 28, 2019 · 2 comments
Labels

Comments

@timholy
Copy link
Contributor

timholy commented Mar 28, 2019

With

function f(x, y)
    z = x+y
    a = z*x
    return a
end

Juno.@run f(1, 2) fails to stop if you set the breakpoint on the first line of the body. It works if you set it at the 2nd or later line. It works at the first line of f if you do Juno.@run g() where g() = f(1, 2).

@timholy timholy added the bug label Mar 28, 2019
@pfitzseb
Copy link
Member

I would argue this is a JuliaInterpreter bug:

julia> JuliaInterpreter.breakpoint(gcd)
8-element Array{BreakpointRef,1}:
 breakpoint(gcd(x::BigInt, y::BigInt) in Base.GMP at gmp.jl:403, line 403)
 breakpoint(gcd(a::T, b::T) where T<:Union{Int128, Int16, Int32, Int64, Int8, UInt128, UInt16, UInt32, UInt64, UInt8} in Base at intfuncs.jl:31, line 31)
 breakpoint(gcd(a::Integer) in Base at intfuncs.jl:75, line 75)
 breakpoint(gcd(a::T, b::T) where T<:Integer in Base at intfuncs.jl:20, line 20)
 breakpoint(gcd(a::Integer, b::Integer) in Base at intfuncs.jl:77, line 77)
 breakpoint(gcd(a::Integer, b::Integer...) in Base at intfuncs.jl:79, line 79)
 breakpoint(gcd(abc::AbstractArray{#s72,N} where N where #s72<:Integer) in Base at intfuncs.jl:85, line 85)
 breakpoint(gcd(x::P, y::P) where P<:Dates.Period in Dates at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Dates\src\periods.jl:75, line 75)

julia> frame = JuliaInterpreter.enter_call_expr(Expr(:call, gcd, 2,3))
Frame for gcd(a::T, b::T) where T<:Union{Int128, Int16, Int32, Int64, Int8, UInt128, UInt16, UInt32, UInt64, UInt8} in Base at intfuncs.jl:31
b  1 31  1 ──       Core.NewvarNode(:(za))
   2 31  │          Core.NewvarNode(:(zb))
   3 31  │          Core.NewvarNode(:(k))
⋮
a = 2
b = 3
T = Int64

julia> ret = JuliaInterpreter.debug_command(frame, :finish)

julia> JuliaInterpreter.get_return(root(frame))
1

JuliaDebug/Debugger.jl#134 is the same issue.

@pfitzseb
Copy link
Member

Fixed by JunoLab/Atom.jl@8d3040c.

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

Successfully merging a pull request may close this issue.

2 participants