Skip to content

Commit

Permalink
Revert "Use compiled mode when there is no chance we will encounter a…
Browse files Browse the repository at this point in the history
… breakpoint (#180)" (#185)

This reverts commit 1a77218.
  • Loading branch information
KristofferC authored Mar 19, 2019
1 parent 1a77218 commit b7b389b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 32 deletions.
14 changes: 0 additions & 14 deletions src/commands.jl
Original file line number Diff line number Diff line change
Expand Up @@ -298,19 +298,6 @@ function unwind_exception(frame::Frame, exc)
rethrow(exc)
end

const always_run_recursive_interpret = Ref(false)
function any_active_breakpoint()
for bp in _breakpoints
if bp.isactive && bp.condition !== always_false
return true
end
end
return break_on_error[]
end
function run_in_compiled()
return !any_active_breakpoint() && !always_run_recursive_interpret[]
end

"""
ret = debug_command(recurse, frame, cmd, rootistoplevel=false)
ret = debug_command(frame, cmd, rootistoplevel=false)
Expand All @@ -332,7 +319,6 @@ or one of the 'advanced' commands
`rootistoplevel` and `ret` are as described for [`JuliaInterpreter.maybe_reset_frame!`](@ref).
"""
function debug_command(@nospecialize(recurse), frame::Frame, cmd::Symbol, rootistoplevel::Bool=false)
recurse = run_in_compiled() ? Compiled() : recurse
istoplevel = rootistoplevel && frame.caller === nothing
cmd0 = cmd
if cmd == :si
Expand Down
18 changes: 0 additions & 18 deletions test/debug.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ using JuliaInterpreter, Test
using JuliaInterpreter: enter_call, enter_call_expr, get_return, @lookup
using Base.Meta: isexpr

# We want to test recursive interpretation
JuliaInterpreter.always_run_recursive_interpret[] = true
@test !JuliaInterpreter.run_in_compiled()

const ALL_COMMANDS = (:n, :s, :c, :finish, :nc, :se, :si)

function step_through_command(fr::Frame, cmd::Symbol)
Expand Down Expand Up @@ -354,18 +350,4 @@ struct B{T} end
@test debug_command(frame, :c) === nothing
@test get_return(frame) == sum(a)
end

@testset "compiled mode when no breakpoints" begin
try
JuliaInterpreter.always_run_recursive_interpret[] = false
remove()
@test JuliaInterpreter.run_in_compiled()
fr = JuliaInterpreter.enter_call(sin, 2.0)
JuliaInterpreter.debug_command(fr, :c)
@test get_return(fr) == sin(2.0)
finally
JuliaInterpreter.always_run_recursive_interpret[] = true
end
end

# end

0 comments on commit b7b389b

Please sign in to comment.