diff --git a/src/commands.jl b/src/commands.jl index 2698aa81533ec9..4ded3057ba52c9 100644 --- a/src/commands.jl +++ b/src/commands.jl @@ -244,7 +244,9 @@ function maybe_step_through_wrapper!(@nospecialize(recurse), frame::Frame) # this is a wrapper function that we might want to step through while frame.pc != length(stmts)-1 pc = next_call!(recurse, frame, false) # since we're in a Method we're not at toplevel - pc === nothing && return frame + if pc === nothing || isa(pc, BreakpointRef) + return frame + end end ret = evaluate_call!(dummy_breakpoint, frame, last) @assert isa(ret, BreakpointRef) diff --git a/test/debug.jl b/test/debug.jl index 70006d1b99f841..a04ee844eed5fd 100644 --- a/test/debug.jl +++ b/test/debug.jl @@ -425,6 +425,14 @@ struct B{T} end @test frame.pc == 1 end + @testset "breakpoints hit during wrapper step through" begin + f(x = g()) = x + g() = 5 + @breakpoint g() + frame = JuliaInterpreter.enter_call(f) + JuliaInterpreter.maybe_step_through_wrapper!(frame) + @test leaf(frame).framecode.scope == @which g() + end @testset "preservation of stack when throwing to toplevel" begin f() = "αβ"[2]