JuliaDebug / JuliaDebug/Debugger.jl

Debugger REPL has no memory

Open
#249 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
514
Forks
50
Avg merge
9d 9h
Merged PRs (30d)
1

Description

julia> function foo(x)
           y = 2x
           a = 1
           return a + y
       end
foo (generic function with 2 methods)

julia> @enter foo(3)
In foo(x) at REPL[13]:2
 1  function foo(x)
>2      y = 2x
 3      a = 1
 4      return a + y
 5  end

About to run: (*)(2, 3)
1|debug> n
In foo(x) at REPL[13]:2
 1  function foo(x)
 2      y = 2x
 3      a = 1
>4      return a + y
 5  end

About to run: (+)(1, 6)
1|julia> asdf = 1234  # I typed ` here to run code in the context of foo() 
1234

1|julia> asdf
ERROR: UndefVarError: asdf not defined

Another issue with this example, unrelated to the title of this issue, is that when I hit n it ran both the y = 2x line and the a = 1 line. As far as I know, hitting n should only run one line.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the example from the issue using the Julia REPL, @enter foo(3), backtick context execution, and n. Start by tracing how the debugger REPL evaluates expressions in the current function context and how n advances execution. Done means assignments remain available in that context and n advances according to the expected source line behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.