Skip to content

Debugger doesn't skip "preamble" defining destructured args on function entry #660

@oscardssmith

Description

@oscardssmith

This should print 1

julia> function foo((a, b), c)
           a + c
       end
foo (generic function with 1 method)

julia> @enter foo((1,2), 3)
In foo(, c) at REPL[3]:1
 1  function foo((a, b), c)
>2      a + c
 3  end

About to run: indexed_iterate((1, 2), 1)
1|julia> a
ERROR: UndefVarError: `a` not defined in `Main`
Suggestion: check for spelling errors or missing imports.
Stacktrace:
  [1] top-level scope
    @ none:1
  [2] eval
    @ ./boot.jl:430 [inlined]
  [3] eval_code(frame::JuliaInterpreter.Frame, expr::Expr)
    @ JuliaInterpreter ~/.julia/packages/JuliaInterpreter/CpHEo/src/utils.jl:722
  [4] eval_code(frame::JuliaInterpreter.Frame, command::String)
    @ JuliaInterpreter ~/.julia/packages/JuliaInterpreter/CpHEo/src/utils.jl:695
  [5] _eval_code(frame::JuliaInterpreter.Frame, code::String)
    @ Debugger ~/.julia/packages/Debugger/zdZP1/src/repl.jl:210
  [6] (::Debugger.var"#27#29"{Debugger.DebuggerState})(s::REPL.LineEdit.MIState, buf::IOBuffer, ok::Bool)
    @ Debugger ~/.julia/packages/Debugger/zdZP1/src/repl.jl:193
  [7] #invokelatest#2
    @ ./essentials.jl:1055 [inlined]
  [8] invokelatest
    @ ./essentials.jl:1052 [inlined]
  [9] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
    @ REPL.LineEdit ~/.julia/juliaup/julia-1.11.3+0.x64.linux.gnu/share/julia/stdlib/v1.11/REPL/src/LineEdit.jl:2755
 [10] run_interface
    @ ~/.julia/juliaup/julia-1.11.3+0.x64.linux.gnu/share/julia/stdlib/v1.11/REPL/src/LineEdit.jl:2749 [inlined]
 [11] RunDebugger(frame::JuliaInterpreter.Frame, repl::Nothing, terminal::Nothing; initial_continue::Bool)
    @ Debugger ~/.julia/packages/Debugger/zdZP1/src/repl.jl:167
 [12] RunDebugger
    @ ~/.julia/packages/Debugger/zdZP1/src/repl.jl:12 [inlined]
 [13] RunDebugger(frame::JuliaInterpreter.Frame)
    @ Debugger ~/.julia/packages/Debugger/zdZP1/src/repl.jl:12
 [14] macro expansion
    @ ~/.julia/packages/Debugger/zdZP1/src/Debugger.jl:127 [inlined]
 [15] top-level scope
    @ REPL[6]:1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions