Skip to content

Commit f877eca

Browse files
authored
fix breakpoints for keyword functions (#641)
fixes JuliaDebug/Debugger.jl#327
1 parent 19af58b commit f877eca

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/breakpoints.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@ function framecode_matches_breakpoint(framecode::FrameCode, bp::BreakpointSignat
9797
meth isa Method || return false
9898
bp.f isa Method && return meth === bp.f
9999
f = extract_function_from_method(meth)
100-
if !(bp.f === f || Core.kwfunc(bp.f) === f)
100+
if !(bp.f === f || @static isdefined(Core, :kwcall) ?
101+
f === Core.kwcall && bp.f isa meth.sig.parameters[3] :
102+
Core.kwfunc(bp.f) === f
103+
)
101104
return false
102105
end
103106
bp.sig === nothing && return true

test/breakpoints.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,4 +589,8 @@ end
589589
g() = fkw(; x=1)
590590
frame, bp = @interpret g()
591591
@test isa(frame, Frame) && isa(bp, JuliaInterpreter.BreakpointRef)
592+
593+
fkw2(;x=1) = x
594+
g2() = fkw2(; x=1)
595+
@test @interpret g2() === 1
592596
end

0 commit comments

Comments
 (0)