timholy / Rebugger.jl

An expression-level debugger for Julia with a provocative command-line (REPL) user interface
Other
171 stars 18 forks source link

Interpret mode fails to show source code when file changes in a method #63

Closed KristofferC closed 5 years ago

KristofferC commented 5 years ago

Function

function f()
           x = 1 + 1
           @info "hello"
       end

Enter interpreted mode and press space a few times

interpret> f()
f() in Main at REPL[18]:2
  x = 2
  level = Info
  std_level = Info
  group = REPL[18]
  _module = Main
  logger = Logging.ConsoleLogger(Base.TTY(Base.Libc.WindowsRawSocke…ting), Info, Logging.default_metafmt, true, 0, Dict{Any,Int64}())
 1  function f()
 2      x = 1 + 1
<?>
KristofferC commented 5 years ago

Related, any opinions about changing the condition in https://github.com/JuliaDebug/JuliaInterpreter.jl/blob/901df4d14f56c7794d1643332ec7728cc5700126/src/commands.jl#L181 to linenumber(frame, pc) == initialline || getfile(frame, pc) != initialfile?

timholy commented 5 years ago

I guess it depends on what we mean by next_line!; if you mean "the next line of this file" then that would be a bad change to make, foo(@lookup(a), @lookup(b)) would not work as expected.