# Debugger.jl, @bp does not work

**URL:** <https://discourse.julialang.org/t/debugger-jl-bp-does-not-work/22154>\
**Category:** General Usage\
**Tags:** package\
**Created:** [March 21, 2019, 4:54pm UTC](https://discourse.julialang.org/t/debugger-jl-bp-does-not-work/22154 "2019-03-21T16:54:01Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![zhangliye](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zhangliye/32/3208_2.png) [@zhangliye](https://discourse.julialang.org/u/zhangliye)\
**Post date:** [March 21, 2019, 4:54pm UTC](https://discourse.julialang.org/t/debugger-jl-bp-does-not-work/22154/1 "2019-03-21T16:54:01Z")

</div>

I get an error when I try to debug a Julia file from REPL as follows.  
The source file main.jl

```julia
# main.jl
using Debugger
function my_add(a::Int, b::Int)
     @bp # want to stop here 
     c = a + b  
     return c
end 

```

Debug in REPL mode as follows.

```julia
> using Debugger
> include("main.jl")
> @run my_add(1, 2)

```

Hower, Julia does not stop at the break point. The other functions work very well. Do I use @bp in a wrong way?

By the way, Debugger.jl is pretty cool! The output in REPL mode is very clear and beautiful. Congratulations!

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [March 21, 2019, 4:58pm UTC](https://discourse.julialang.org/t/debugger-jl-bp-does-not-work/22154/2 "2019-03-21T16:58:32Z")

</div>

This is sort of a bug but will only happen if you have `@bp` as the very first thing in the very first function you run (and then you might as well do `@enter`).

For example:

```julia
julia> function my_add(a::Int, b::Int)
           @bp # want to stop here
           c = a + b
           return c
       end
my_add (generic function with 1 method)

julia> f(a, b) = my_add(a, b)
f (generic function with 1 method)

julia> @run f(1, 2)
Hit breakpoint:
In my_add(a, b) at REPL[25]:2
●2 @bp # want to stop here
>3 c = a + b
 4 return c
 5 end

About to run: (+)(1, 2)
1|debug> 

```

I’ll fix it though.

---

<div class="post-metadata">

**Author:** ![zhangliye](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zhangliye/32/3208_2.png) [@zhangliye](https://discourse.julialang.org/u/zhangliye)\
**Post date:** [March 21, 2019, 5:05pm UTC](https://discourse.julialang.org/t/debugger-jl-bp-does-not-work/22154/3 "2019-03-21T17:05:38Z")

</div>

I am working on a big project and there are a lot of Julia files. Thus, it is convenient to set the break point in this way.

@kristoffer.carlsson Thank you so much for your excellent work on Debugger.jl. It must be the biggest news in Julia community after the release of Julia 1.0. Congratulations!

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [March 21, 2019, 5:19pm UTC](https://discourse.julialang.org/t/debugger-jl-bp-does-not-work/22154/4 "2019-03-21T17:19:54Z")

</div>

Why not set a breakpoint on `my_add` then (with `breakpoint(my_add)`)?

---

<div class="post-metadata">

**Author:** ![zhangliye](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zhangliye/32/3208_2.png) [@zhangliye](https://discourse.julialang.org/u/zhangliye)\
**Post date:** [March 21, 2019, 5:31pm UTC](https://discourse.julialang.org/t/debugger-jl-bp-does-not-work/22154/5 "2019-03-21T17:31:45Z")

</div>

It does not stop at the line of @bp. Waiting for the integration of Juno and the debug function. Thanks for your work!

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [March 21, 2019, 5:36pm UTC](https://discourse.julialang.org/t/debugger-jl-bp-does-not-work/22154/6 "2019-03-21T17:36:47Z")

</div>

True, will fix that asap. I’d suggest setting normal breakpoints for now using the GUI.

---

<div class="post-metadata">

**Author:** ![IljaK91](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iljak91/32/44301_2.png) [@IljaK91](https://discourse.julialang.org/u/IljaK91)\
**Post date:** [March 21, 2019, 5:50pm UTC](https://discourse.julialang.org/t/debugger-jl-bp-does-not-work/22154/7 "2019-03-21T17:50:28Z")

</div>

Is there some documentation for the debugger in Juno? I didn’t realize that graphical breakpoints work

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [March 21, 2019, 5:51pm UTC](https://discourse.julialang.org/t/debugger-jl-bp-does-not-work/22154/8 "2019-03-21T17:51:47Z")

</div>

Not really, but [[ANN] Juno 0.8](https://discourse.julialang.org/t/ann-juno-0-8/22157) provides a short overview over what you can do. I’ll write more comprehensive docs once I find some time and motivation for that…

---

<div class="post-metadata">

**Author:** ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Post date:** [March 21, 2019, 6:13pm UTC](https://discourse.julialang.org/t/debugger-jl-bp-does-not-work/22154/9 "2019-03-21T18:13:49Z")

</div>

This actually works fine, provided you qualify `@bp` properly and don’t have it as the first line in your function:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/7/6/7657805b527d90a1235d026d9dd4c5eddb3f1630.png)

So yeah, this isn’t really a priority.
