Set a breakpoint in the custom module

I want to set up breakpoint in the custom module.

My module is in the file “utils.jl”:

using Revise
using Debugger

module Utils

export myfunc2

function myfunc2(x)
    x = x .^2
    @bp
    x = x .+ 3
end


end

When I run it from here:

using Revise
using Debugger

include("utils.jl")

using .Utils

@run myfunc2([1. 2.])

I get an error:

ERROR: LoadError: LoadError: LoadError: UndefVarError: @bp not definedStacktrace:
 [1] top-level scope [2] include at .\boot.jl:326 [inlined] [3] include_relative(::Module, ::String) at .\loading.jl:1038
 [4] include(::Module, ::String) at .\sysimg.jl:29 [5] include(::String) at .\client.jl:403 [6] top-level scope at none:0
 [7] include at .\boot.jl:326 [inlined]
 [8] include_relative(::Module, ::String) at .\loading.jl:1038
 [9] include(::Module, ::String) at .\sysimg.jl:29
 [10] include(::String) at .\client.jl:403
 [11] top-level scope at none:0
in expression starting at d:\Playground\julia-experiment\JuliaDebugging\utils.jl:10
in expression starting at d:\Playground\julia-experiment\JuliaDebugging\utils.jl:8
in expression starting at d:\Playground\julia-experiment\JuliaDebugging\main.jl:4

If I do everything in one file, I don’t have any errors.
E.g:

using Revise
using Debugger

function myfunc1(x)
    x = x .^4
    @bp
    x = x .+ 13
end

@run myfunc1([1. 2.])

Any idea how can I setup breakpoint in the different file?

I’ve solved this issue. I need to move the statement “using Debugger” to the inside of the imported module.

module Utils

using Debugger

export myfunc2

function myfunc2(x)
    x = x .^2
    @bp
    x = x .+ 3
end

end