# Using Debugger in Julia 1.6.3

**URL:** <https://discourse.julialang.org/t/using-debugger-in-julia-1-6-3/71095>\
**Category:** General Usage\
**Tags:** question, package\
**Created:** [November 7, 2021, 1:52pm UTC](https://discourse.julialang.org/t/using-debugger-in-julia-1-6-3/71095 "2021-11-07T13:52:06Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![kw\_martin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kw_martin/32/48868_2.png) [@kw\_martin](https://discourse.julialang.org/u/kw_martin)\
**Post date:** [November 7, 2021, 1:52pm UTC](https://discourse.julialang.org/t/using-debugger-in-julia-1-6-3/71095/1 "2021-11-07T13:52:07Z")

</div>

I am having difficulties using Debugger in Julia 1.6.3. I attempted to run the simple example from [Debugger at github](https://github.com/JuliaDebug/Debugger.jl) and if failed. Can someone suggest what I am doing wrong or a work-around. I do have vscode working, but having to stop and start it every time I change a struct is making code development slow. Thanks.

```julia
julia> using Pkg;Pkg.add("Debugger")
julia> function foo(n)
           x = n+1
           ((BigInt[1 1; 1 0])^x)[2,1]
       end
foo (generic function with 1 method)

julia> @enter foo(20)
ERROR: LoadError: UndefVarError: @enter not defined
in expression starting at REPL[25]:1

```

---

<div class="post-metadata">

**Author:** ![ianshmean](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ianshmean/32/216042_2.png) [@ianshmean](https://discourse.julialang.org/u/ianshmean)\
**Post date:** [November 7, 2021, 2:47pm UTC](https://discourse.julialang.org/t/using-debugger-in-julia-1-6-3/71095/2 "2021-11-07T14:47:35Z")

</div>

You need to load Debugger

```julia
Julia> using Debugger

```

---

<div class="post-metadata">

**Author:** ![kw\_martin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kw_martin/32/48868_2.png) [@kw\_martin](https://discourse.julialang.org/u/kw_martin)\
**Post date:** [November 7, 2021, 2:53pm UTC](https://discourse.julialang.org/t/using-debugger-in-julia-1-6-3/71095/3 "2021-11-07T14:53:59Z")

</div>

Sorry, my apologies; however:

```nohighlight

julia> function foo(n)
           x = n+1
           ((BigInt[1 1; 1 0])^x)[2,1]
       end
foo (generic function with 1 method)

julia> @enter foo(20)
In foo(n) at REPL[45]:1
 1 function foo(n)
>2 x = n+1
 3 ((BigInt[1 1; 1 0])^x)[2,1]
 4 end

About to run: (+)(20, 1)
1|debug> n
ERROR: UndefVarError: _apply_latest not defined
Stacktrace:
 [1] +(x::Int64, y::Int64)
   @ Base int.jl:87
 [2] foo(n::Int64)
   @ Main REPL[45]:2

julia>

```

---

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [November 7, 2021, 3:00pm UTC](https://discourse.julialang.org/t/using-debugger-in-julia-1-6-3/71095/4 "2021-11-07T15:00:01Z")

</div>

There’s something wrong with your code formatting. Can you put the code inside triple backticks? Now it literally says “blockquote”, which is very odd.

---

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [November 7, 2021, 3:03pm UTC](https://discourse.julialang.org/t/using-debugger-in-julia-1-6-3/71095/5 "2021-11-07T15:03:28Z")

</div>

Here’s an explanation how to format your code [Please read: make it easier to help you](https://discourse.julialang.org/t/please-read-make-it-easier-to-help-you/14757)

---

<div class="post-metadata">

**Author:** ![zgornel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zgornel/32/217487_2.png) [@zgornel](https://discourse.julialang.org/u/zgornel)\
**Post date:** [November 7, 2021, 5:04pm UTC](https://discourse.julialang.org/t/using-debugger-in-julia-1-6-3/71095/6 "2021-11-07T17:04:31Z")

</div>

Just tried the example, worked for me.

---

<div class="post-metadata">

**Author:** ![kw\_martin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kw_martin/32/48868_2.png) [@kw\_martin](https://discourse.julialang.org/u/kw_martin)\
**Post date:** [November 7, 2021, 5:23pm UTC](https://discourse.julialang.org/t/using-debugger-in-julia-1-6-3/71095/7 "2021-11-07T17:23:26Z")

</div>

Thank you, I requested help on this in “Getting Started”. I will read your suggested link immediately after this reply.

---

<div class="post-metadata">

**Author:** ![kw\_martin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kw_martin/32/48868_2.png) [@kw\_martin](https://discourse.julialang.org/u/kw_martin)\
**Post date:** [November 7, 2021, 5:29pm UTC](https://discourse.julialang.org/t/using-debugger-in-julia-1-6-3/71095/8 "2021-11-07T17:29:07Z")

</div>

I’m doing something incorrect, but I don’t know what. I just recently downloaded 1.6.3 and am only running the example from the github readme.md. I’m running Ubuntu 20.04 on an old desktop.

```julia
Linux home-ubuntu 5.11.0-38-generic #42~20.04.1-Ubuntu SMP Tue Sep 28 20:41:07 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
> 

```

If you have any suggestions on how to debug, I will give them a try. I really want to get Debugger working. Thanks.  
p.s. I have been away from julia for a year, but have now decided to use it more (because it’s so much faster than Python).

---

<div class="post-metadata">

**Author:** ![simeonschaub](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simeonschaub/32/216566_2.png) [@simeonschaub](https://discourse.julialang.org/u/simeonschaub)\
**Post date:** [November 7, 2021, 5:38pm UTC](https://discourse.julialang.org/t/using-debugger-in-julia-1-6-3/71095/9 "2021-11-07T17:38:02Z")

</div>

Where did you get Julia from? Did you download the [official binaries](https://julialang.org/downloads/)?

---

<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:** [November 7, 2021, 5:54pm UTC](https://discourse.julialang.org/t/using-debugger-in-julia-1-6-3/71095/10 "2021-11-07T17:54:51Z")

</div>

> [@kw\_martin](#):
>
> I do have vscode working, but having to stop and start it every time I change a struct is making code development slow.

How’s VS Code any different here from the REPL?

---

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [November 7, 2021, 7:37pm UTC](https://discourse.julialang.org/t/using-debugger-in-julia-1-6-3/71095/11 "2021-11-07T19:37:11Z")

</div>

You can edit your previous posts and fix the formatting.

---

<div class="post-metadata">

**Author:** ![kw\_martin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kw_martin/32/48868_2.png) [@kw\_martin](https://discourse.julialang.org/u/kw_martin)\
**Post date:** [November 7, 2021, 9:57pm UTC](https://discourse.julialang.org/t/using-debugger-in-julia-1-6-3/71095/12 "2021-11-07T21:57:16Z")

</div>

Yes, julia-1.6.3-linux-x86\_64.tar.gz from [julialang.org](https://julialang.org/downloads/)

---

<div class="post-metadata">

**Author:** ![kw\_martin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kw_martin/32/48868_2.png) [@kw\_martin](https://discourse.julialang.org/u/kw_martin)\
**Post date:** [November 7, 2021, 10:04pm UTC](https://discourse.julialang.org/t/using-debugger-in-julia-1-6-3/71095/13 "2021-11-07T22:04:02Z")

</div>

Repl with Debugging should be much faster to try alternatives when developing code. VSCode (well code on ubuntu) is very slow to start up each time you make a change. Also, different functionality. My preference is to run both in parallel, and to use cut and paste with an external editor (for me sublime-text) and at any particular time to use what is most efficient. I expect everyone has their own methodology they get used to.

---

<div class="post-metadata">

**Author:** ![kw\_martin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kw_martin/32/48868_2.png) [@kw\_martin](https://discourse.julialang.org/u/kw_martin)\
**Post date:** [November 9, 2021, 6:31pm UTC](https://discourse.julialang.org/t/using-debugger-in-julia-1-6-3/71095/14 "2021-11-09T18:31:45Z")

</div>

It might be an Ubuntu issue; I have tried the Debugger example on a couple of Ubuntu 12.04 machines and I get the same failure issue. Unfortuantely, I am too inexperienced with Julia to figure out how to debug it, especially with Debugger not working for me. I expect I am doing something simple incorrecly, but don’t know what it is.

---

<div class="post-metadata">

**Author:** ![ToucheSir](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/touchesir/32/14411_2.png) [@ToucheSir](https://discourse.julialang.org/u/ToucheSir)\
**Post date:** [November 9, 2021, 6:38pm UTC](https://discourse.julialang.org/t/using-debugger-in-julia-1-6-3/71095/15 "2021-11-09T18:38:26Z")

</div>

I run both stable (1.6.3) and RC (1.7) Julia on 2 Ubuntu machines (18.04 and 20.04), so this should work. Can you try again on a clean environment (i.e. not the global one) and see if that works?

---

<div class="post-metadata">

**Author:** ![kw\_martin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kw_martin/32/48868_2.png) [@kw\_martin](https://discourse.julialang.org/u/kw_martin)\
**Post date:** [November 11, 2021, 4:35pm UTC](https://discourse.julialang.org/t/using-debugger-in-julia-1-6-3/71095/16 "2021-11-11T16:35:50Z")

</div>

I don’t understand what a clean environment or what the global environment is. Does this mean just start a new repl? Or does it have to do with environment variables in the linux shell?

---

<div class="post-metadata">

**Author:** ![kw\_martin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kw_martin/32/48868_2.png) [@kw\_martin](https://discourse.julialang.org/u/kw_martin)\
**Post date:** [November 11, 2021, 5:08pm UTC](https://discourse.julialang.org/t/using-debugger-in-julia-1-6-3/71095/17 "2021-11-11T17:08:22Z")

</div>

If I try it in a none-project directory, it works; trying in my project directory fails:

```julia
1|debug> n
ERROR: UndefVarError: _apply_latest not defined
Stacktrace:
 [1] +(x::Int64, y::Int64)
   @ Base int.jl:87
 [2] foo(n::Int64)
   @ Main REPL[3]:2

```

---

<div class="post-metadata">

**Author:** ![kw\_martin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kw_martin/32/48868_2.png) [@kw\_martin](https://discourse.julialang.org/u/kw_martin)\
**Post date:** [February 8, 2022, 1:30am UTC](https://discourse.julialang.org/t/using-debugger-in-julia-1-6-3/71095/18 "2022-02-08T01:30:45Z")

</div>

More information: the only change made was to upgrade to 1.7.1 and now Debugger seems to be working in Ubuntu 20.04
