timholy / Rebugger.jl

An expression-level debugger for Julia with a provocative command-line (REPL) user interface

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem with step-in

adamryczkowski opened this issue · comments

To reproduce:

  1. Clear ~/.julia
  2. Edit ~/.julia/config/startup.jl, so it reads:
try
    @eval using Revise
    # Turn on Revise's file-watching behavior
    Revise.async_steal_repl_backend()
catch
    @warn "Could not load Revise."
end

try
    @eval using Rebugger
    # Activate Rebugger's key bindings
    atreplinit(Rebugger.repl_init)
catch
    @warn "Could not turn on Rebugger key bindings."
end
  1. Launch julia 1.0.0 and execute import Pkg; Pkg.add("Rebugger"), then exit
  2. Launch julia again, and execute Rebugger.add_keybindings(stepin="\e[17~", stacktrace="\e[18~")
  3. Type show([1, 2, 4]), put cursor on the beginning of this string and press F6.
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.0.0 (2018-08-08)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> Rebugger.add_keybindings(stepin="\e[17~", stacktrace="\e[18~")

julia> show([1,2,3])
[1, 2, 3]┌ Error: Error in the keymap
│   exception =
│    show([1, 2, 3]) did not throw an error
│    Stacktrace:
│     [1] error(::String) at ./error.jl:33
│     [2] capture_stacktrace(::Module, ::Expr) at /home/adam/.julia/packages/Rebugger/tYJpU/src/debug.jl:170
│     [3] capture_stacktrace(::Expr) at /home/adam/.julia/packages/Rebugger/tYJpU/src/debug.jl:181
│     [4] capture_stacktrace(::REPL.LineEdit.MIState) at /home/adam/.julia/packages/Rebugger/tYJpU/src/ui.jl:136
│     [5] (::getfield(Rebugger, Symbol("##18#22")))(::REPL.LineEdit.MIState, ::REPL.LineEditREPL, ::Vararg{Any,N} where N) at /home/adam/.julia/packages/Rebugger/tYJpU/src/ui.jl:251
│     [6] #invokelatest#1 at ./essentials.jl:686 [inlined]
│     [7] invokelatest at ./essentials.jl:685 [inlined]
│     [8] (::getfield(REPL.LineEdit, Symbol("##27#28")){getfield(Rebugger, Symbol("##18#22")),String})(::Any, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/REPL/src/LineEdit.jl:1319
│     [9] prompt!(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/REPL/src/LineEdit.jl:2353
│     [10] run_interface(::REPL.Terminals.TextTerminal, ::REPL.LineEdit.ModalInterface, ::REPL.LineEdit.MIState) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/REPL/src/LineEdit.jl:2256
│     [11] run_frontend(::REPL.LineEditREPL, ::REPL.REPLBackendRef) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/REPL/src/REPL.jl:1029
│     [12] run_repl(::REPL.AbstractREPL, ::Any) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/REPL/src/REPL.jl:191
│     [13] (::getfield(Base, Symbol("##720#722")){Bool,Bool,Bool,Bool})(::Module) at ./logging.jl:311
│     [14] #invokelatest#1 at ./essentials.jl:686 [inlined]
│     [15] invokelatest at ./essentials.jl:685 [inlined]
│     [16] macro expansion at ./logging.jl:308 [inlined]
│     [17] run_main_repl(::Bool, ::Bool, ::Bool, ::Bool, ::Bool) at ./client.jl:330
│     [18] exec_options(::Base.JLOptions) at ./client.jl:242
│     [19] _start() at ./client.jl:421
└ @ REPL.LineEdit 

Whatever you pressed mapped to stacktrace rather than stepin.

Yes... how silly of me. I am really sorry for taking so much of your time. Perhaps I can contribute back to the manual if you do not mind?

That would be divine! To err is human, and so a good manual tries to anticipate all the ways in which one can be human 😄 Rebugger's manual isn't there yet!