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

Breakpoint on lines doesnt seem to work properly? #33

Open
KristofferC opened this issue Mar 21, 2019 · 5 comments
Open

Breakpoint on lines doesnt seem to work properly? #33

KristofferC opened this issue Mar 21, 2019 · 5 comments
Labels
256ish For bugs that go away when you restart julia

Comments

@KristofferC
Copy link
Contributor

shell> cat ../file.jl
function gg(x)
    z = :foo
    b = "fdsf"
    q = Expr(:call, sin, 1)
    print(x)
end

julia> set_breakpoint!(abspath("../file.jl"), 3)
1-element Array{MagneticReadHead.Rule,1}:
 MagneticReadHead.Rule{Method}(gg(x) in Main at /mnt/c/Users/Kristoffer/Debugging/file.jl:2, 2)
julia> @iron_debug gg(2)
2

I would have thought that I would have stopped on b = with the breakpoint on line 3.

@KristofferC KristofferC changed the title Breakpoit on lines doesnt seem to work properly? Breakpoint on lines doesnt seem to work properly? Mar 21, 2019
@oxinabox
Copy link
Owner

oxinabox commented Mar 21, 2019

This should be getting caught by this test case:
(ignore the outdated comment)

@testset "breakpoint by file and linenum" begin
make_readline_patch(["CC"])
record = make_recording_breakpoint_hit_patch()
# This doesn't work as demo.jl is not in a package.
set_breakpoint!("demo.jl", 9)
@test !isempty(list_breakpoints())
@iron_debug eg1()
@test first.(record) == [eg2]
end

I wonder what is different

@KristofferC
Copy link
Contributor Author

Ok, it works now when I restarted Julia.

Perhaps some #265 ish?

julia> @iron_debug gg(2)

Breakpoint Hit: gg(x) in Main at /mnt/c/Users/Kristoffer/Debugging/file.jl:2 function gg(x)
     z = :foo
➧    b = "fdsf"
     q = Expr(:call, sin, 1)
     print(x)

Vars: x, z
Commands: CC (Continue), SI (Step In), SN (Step Next), SO (Step Out), XX (Abort)
iron>

@oxinabox
Copy link
Owner

Hmmm,
yes, I have no idea where the #256 bugs are in v0.2,
I managed to get rid of them for v0.1
(with a lot of invokelatest)
but v0.2 works very differently.

@oxinabox oxinabox added the 256ish For bugs that go away when you restart julia label Mar 21, 2019
@KristofferC
Copy link
Contributor Author

However, some lines doesn't trigger:

julia> using Revise; using MagneticReadHead

shell> cat ../file.jl
function gg(x)
    z = :foo
    b = "fdsf"
    q = Expr(:call, sin, 1)
    print(x)
    x = 2
end

julia> includet("../file.jl")

julia> set_breakpoint!(abspath("../file.jl"), 5)
1-element Array{MagneticReadHead.Rule,1}:
 MagneticReadHead.Rule{Method}(gg(x) in Main at /mnt/c/Users/Kristoffer/Debugging/file.jl:2,
5)

julia> @iron_debug gg(2) # nope
22

julia> set_breakpoint!(abspath("../file.jl"), 3)
2-element Array{MagneticReadHead.Rule,1}:
 MagneticReadHead.Rule{Method}(gg(x) in Main at /mnt/c/Users/Kristoffer/Debugging/file.jl:2,
5)
 MagneticReadHead.Rule{Method}(gg(x) in Main at /mnt/c/Users/Kristoffer/Debugging/file.jl:2,
3)

julia> @iron_debug gg(2) # nope
22

julia> set_breakpoint!(abspath("../file.jl"), 4)
3-element Array{MagneticReadHead.Rule,1}:
 MagneticReadHead.Rule{Method}(gg(x) in Main at /mnt/c/Users/Kristoffer/Debugging/file.jl:2,
5)
 MagneticReadHead.Rule{Method}(gg(x) in Main at /mnt/c/Users/Kristoffer/Debugging/file.jl:2,
3)
 MagneticReadHead.Rule{Method}(gg(x) in Main at /mnt/c/Users/Kristoffer/Debugging/file.jl:2,
4)

julia> @iron_debug gg(2) # ok

Breakpoint Hit: gg(x) in Main at /mnt/c/Users/Kristoffer/Debugging/file.jl:2     z = :foo
     b = "fdsf"
➧    q = Expr(:call, sin, 1)
     print(x)
     x = 2

Vars: x, z
Commands: CC (Continue), SI (Step In), SN (Step Next), SO (Step Out), XX (Abort)
iron>

@oxinabox oxinabox reopened this Mar 21, 2019
@oxinabox
Copy link
Owner

oxinabox commented Jun 3, 2019

This would be because I was doing line numbers wrong.
It should be fixed on master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
256ish For bugs that go away when you restart julia
Projects
None yet
Development

No branches or pull requests

2 participants