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

don't step over breakpoint on first statement #148

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

pfitzseb
Copy link
Member

Fixes #134.

@codecov-io
Copy link

codecov-io commented Mar 29, 2019

Codecov Report

Merging #148 into master will increase coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #148      +/-   ##
==========================================
+ Coverage   80.59%   80.63%   +0.04%     
==========================================
  Files           7        7              
  Lines         474      475       +1     
==========================================
+ Hits          382      383       +1     
  Misses         92       92
Impacted Files Coverage Δ
src/repl.jl 77.04% <100%> (ø) ⬆️
src/Debugger.jl 91.3% <100%> (+0.39%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f8720a9...23c0964. Read the comment docs.

@KristofferC
Copy link
Member

Will this work even if we step through a wrapper function with a breakpoint?

@pfitzseb
Copy link
Member Author

You mean for something like

julia> f(x; y=3) = x+y
f (generic function with 1 method)

julia> @breakpoint f(2, y=3)
breakpoint((::getfield(Main, Symbol("#kw##f")))(::Any, ::typeof(f), x) in Main, line 0)

julia> @run f(2,y=3)
5

? No. We could use

    quote
        theargs = $(esc(args))
        frame = JuliaInterpreter.enter_call_expr(Expr(:call,theargs...))
        if frame ≠ nothing && !JuliaInterpreter.shouldbreak(frame, frame.pc)
            frame = JuliaInterpreter.maybe_step_through_kwprep!(frame)
            if frame ≠ nothing && !JuliaInterpreter.shouldbreak(frame, frame.pc)
                frame = JuliaInterpreter.maybe_step_through_wrapper!(frame)
                if frame ≠ nothing && !JuliaInterpreter.shouldbreak(frame, frame.pc)
                    JuliaInterpreter.maybe_next_call!(frame)
                end
            end
        end
        frame
    end

for that to work though, although I'd kinda argue that the breakpoint shouldn't be set in the wrapper at all. Alternatively we could maybe handle this on the JuliaInterpreter side somewhat like 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

Successfully merging this pull request may close these issues.

Don't skip any initial stuff with @run
3 participants