Julia Debugger

This is an English version documentation for our Julia Debugger in Julia IntelliJ plugin. Our debugger is a wrapper based on Keno Fischer's DebuggerFramework and ASTInterpreter2.

First of all, pay our respects to Keno!

Overview

gif

Installation & Usage (from github repositoriy)

Install IntelliJ IDEA (or other JetBrains IntelliJ platform IDEs such as PyCharm / WebStorm / Goland / and even Android Studio:joy:), open Settings (Preferences for macOS) | Plugins | Browse repositories, install Julia plugin, and create a Julia project.

Dependencies

  • ASTInterpreter2#master
  • DebuggerFramework#master
  • JSON
  • Julia 0.7+
(the master is needed for debugger)

add packages

(v1.0) pkg> add DebuggerFramework#master
(v1.0) pkg> add ASTInterpreter2#master
(v1.0) pkg> add JSON

Create a Julia project after adding the plugin, and write simple sample codes:

function func()
    i = 10
    while i>0
        println(sin(i))
        i-=2
    end
end

@enter func()

use @enter macro before a function call expression as ASTInterpreter2 do. And put a breakpoint at any line (which is useless but necessary on account of JB's IDE), the functional is @enter macro, not breakpoints.

then you'll notice that the Debug button at upper right corner is avalible, which is shown as a green bug. Press it!

Note!!!

If you use this debugger in Windows, the first time you run the debugger may froze your IDE about 2 minutes tested in my PC, while it'll become normal at the second time. So we strongly recommend that you'd better not use this debugger in Windows.

Debug mode

Relayout your debug panel like this by dragging:

relayout You can see call stackframes at the left of panel and local variables at right.

Functions

step over

  • Step over : Run next call in current file. The nc command for DebuggerFramework.
  • Step into : Run the next call into a deeper stackframes. The sg command for DebuggerFramework.
  • Froce Step into : (maybe useless). s command.
  • Step out : Run out of current stackframes. finish command.
  • Run to cursor(unsupported currently). Do not try this button.
  • Rerun: Rerun the Julia program and debug.
  • Resume |▶: Rerun the debug when debug session is not terminated. (Note that debug session will not exit until you press the Red Stop Rectangle Button)