@@ -162,6 +162,9 @@ function changed_line!(expr, line, fls)
162
162
end
163
163
end
164
164
165
+ # Sentinel to see if the call was a wrapper call
166
+ struct Wrapper end
167
+
165
168
"""
166
169
pc = next_line!(recurse, frame, istoplevel=false)
167
170
pc = next_line!(frame, istoplevel=false)
@@ -236,7 +239,7 @@ function maybe_step_through_wrapper!(@nospecialize(recurse), frame::Frame)
236
239
last = stmts[end - 1 ]
237
240
isexpr (last, :(= )) && (last = last. args[2 ])
238
241
is_kw = isa (scope, Method) && startswith (String (Base. unwrap_unionall (Base. unwrap_unionall (scope. sig). parameters[1 ]). name. name), " #kw" )
239
- if is_kw || isexpr (last, :call ) && any (x -> x == Core. SlotNumber (1 ), last. args)
242
+ if is_kw || isexpr (last, :call ) && any (isequal ( Core. SlotNumber (1 ) ), last. args)
240
243
# If the last expr calls #self# or passes it to an implementation method,
241
244
# this is a wrapper function that we might want to step through
242
245
while frame. pc != length (stmts)- 1
@@ -245,6 +248,7 @@ function maybe_step_through_wrapper!(@nospecialize(recurse), frame::Frame)
245
248
end
246
249
ret = evaluate_call! (dummy_breakpoint, frame, last)
247
250
@assert isa (ret, BreakpointRef)
251
+ frame. framedata. ssavalues[frame. pc] = Wrapper ()
248
252
return maybe_step_through_wrapper! (recurse, callee (frame))
249
253
end
250
254
return frame
@@ -339,8 +343,13 @@ function maybe_reset_frame!(@nospecialize(recurse), frame::Frame, @nospecialize(
339
343
frame = caller (frame)
340
344
frame === nothing && return nothing
341
345
frame. callee = nothing
346
+ ssavals = frame. framedata. ssavalues
347
+ is_wrapper = isassigned (ssavals, frame. pc) && ssavals[frame. pc] === Wrapper ()
342
348
maybe_assign! (frame, val)
343
349
frame. pc += 1
350
+ if is_wrapper
351
+ return maybe_reset_frame! (recurse, frame, finish! (recurse, frame), rootistoplevel)
352
+ end
344
353
pc = maybe_next_call! (recurse, frame, rootistoplevel && frame. caller=== nothing )
345
354
return maybe_reset_frame! (recurse, frame, pc, rootistoplevel)
346
355
end
0 commit comments