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 skipped when set on function #297

Closed
fredrikekre opened this issue Oct 18, 2021 · 2 comments
Closed

Breakpoint skipped when set on function #297

fredrikekre opened this issue Oct 18, 2021 · 2 comments

Comments

@fredrikekre
Copy link
Contributor

Likely related to keyword arguments. Did not manage to find a MWE just yet, but this should reproduce it:

$ pkg st
      Status `/tmp/tmp.NYFUEV6YuR/Project.toml`
  [31a5f54b] Debugger v0.6.8
  [98b081ad] Literate v2.9.3

$ julia -q
julia> write("test.jl", "hello");

julia> using Debugger, Literate

julia> @enter Literate.markdown("test.jl")
In #markdown#27(config, kwargs, , inputfile, outputdir) at /home/fredrik/.julia/packages/Literate/3Mk7t/src/Literate.jl:488
 488  function markdown(inputfile, outputdir=pwd(); config::Dict=Dict(), kwargs...)
 489      # preprocessing and parsing
>490      chunks, config =
 491          preprocessor(inputfile, outputdir; user_config=config, user_kwargs=kwargs, type=:md)
 492  
 493      # create the markdown file
 494      sb = sandbox()

About to run: (Core.apply_type)(NamedTuple, (:user_config, :user_kwargs, :type))
1|debug> bp add Literate.preprocessor
[ Info: added breakpoint for function preprocessor
1] preprocessor

1|debug> c
[ Info: generating markdown page from `/tmp/tmp.NYFUEV6YuR/test.jl`
[ Info: writing result to `/tmp/tmp.NYFUEV6YuR/test.md`
"/tmp/tmp.NYFUEV6YuR/test.md"

julia>
@fredrikekre
Copy link
Contributor Author

Okay, here is a smaller example:

julia> function f(a; b=1)
           @info "in f"
       end
f (generic function with 1 method)

julia> function g()
           x = 1
           y = f(x, b=x)
           return y
       end
g (generic function with 1 method)

julia> using Debugger

julia> @enter g()
In g() at REPL[2]:1
 1  function g()
 2      x = 1
>3      y = f(x, b=x)
 4      return y
 5  end

About to run: (Core.apply_type)(NamedTuple, (:b,))
1|debug> bp add f
[ Info: added breakpoint for function f
1] f

1|debug> c
[ Info: in f

julia>

with

$ pkg st -m 
      Status `/tmp/tmp.NYFUEV6YuR/Manifest.toml`
  [da1fd8a2] CodeTracking v1.0.6
  [a8cc5b0e] Crayons v4.0.4
  [31a5f54b] Debugger v0.6.8
  [ffbed154] DocStringExtensions v0.8.5
  [eafb193a] Highlights v0.4.5
  [aa1ae85d] JuliaInterpreter v0.8.21

@KristofferC
Copy link
Member

KristofferC commented Sep 16, 2022

This have been fixed.

1|debug> bp add f
[ Info: added breakpoint for function f
1] f

1|debug> c
Hit breakpoint:
In f##kw(, , a) at REPL[3]:1
>1  function f(a; b=1)
 2      @info "in f"
 3  end

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