@@ -295,39 +295,51 @@ struct B{T} end
295
295
finally
296
296
break_off (:error )
297
297
end
298
+ end
298
299
299
- @testset " breakpoints" begin
300
- # In source breakpoints
301
- function f_bp (x)
302
- #= 1=# i = 1
303
- #= 2=# @label foo
304
- #= 3=# @bp
305
- #= 4=# repr (" foo" )
306
- #= 5=# i += 1
307
- #= 6=# i > 3 && return x
308
- #= 7=# @goto foo
309
- end
310
- ln = @__LINE__
311
- method_start = ln - 9
312
- fr = enter_call (f_bp, 2 )
313
- @test JuliaInterpreter. linenumber (fr) == method_start + 1
314
- fr, pc = JuliaInterpreter. debug_command (fr, :c )
315
- # Hit the breakpoint x1
316
- @test JuliaInterpreter. linenumber (fr) == method_start + 3
317
- @test pc isa BreakpointRef
318
- fr, pc = JuliaInterpreter. debug_command (fr, :n )
319
- @test JuliaInterpreter. linenumber (fr) == method_start + 4
320
- fr, pc = JuliaInterpreter. debug_command (fr, :c )
321
- # Hit the breakpoint again x2
322
- @test pc isa BreakpointRef
323
- @test JuliaInterpreter. linenumber (fr) == method_start + 3
324
- fr, pc = JuliaInterpreter. debug_command (fr, :c )
325
- # Hit the breakpoint for the last time x3
326
- @test pc isa BreakpointRef
327
- @test JuliaInterpreter. linenumber (fr) == method_start + 3
328
- JuliaInterpreter. debug_command (fr, :c )
329
- @test get_return (fr) == 2
300
+ @testset " breakpoints" begin
301
+ # In source breakpoints
302
+ function f_bp (x)
303
+ #= 1=# i = 1
304
+ #= 2=# @label foo
305
+ #= 3=# @bp
306
+ #= 4=# repr (" foo" )
307
+ #= 5=# i += 1
308
+ #= 6=# i > 3 && return x
309
+ #= 7=# @goto foo
330
310
end
311
+ ln = @__LINE__
312
+ method_start = ln - 9
313
+ fr = enter_call (f_bp, 2 )
314
+ @test JuliaInterpreter. linenumber (fr) == method_start + 1
315
+ fr, pc = JuliaInterpreter. debug_command (fr, :c )
316
+ # Hit the breakpoint x1
317
+ @test JuliaInterpreter. linenumber (fr) == method_start + 3
318
+ @test pc isa BreakpointRef
319
+ fr, pc = JuliaInterpreter. debug_command (fr, :n )
320
+ @test JuliaInterpreter. linenumber (fr) == method_start + 4
321
+ fr, pc = JuliaInterpreter. debug_command (fr, :c )
322
+ # Hit the breakpoint again x2
323
+ @test pc isa BreakpointRef
324
+ @test JuliaInterpreter. linenumber (fr) == method_start + 3
325
+ fr, pc = JuliaInterpreter. debug_command (fr, :c )
326
+ # Hit the breakpoint for the last time x3
327
+ @test pc isa BreakpointRef
328
+ @test JuliaInterpreter. linenumber (fr) == method_start + 3
329
+ JuliaInterpreter. debug_command (fr, :c )
330
+ @test get_return (fr) == 2
331
+ end
332
+
333
+ f_inv (x:: Real ) = x^ 2 ;
334
+ f_inv (x:: Integer ) = 1 + invoke (f_inv, Tuple{Real}, x)
335
+ @testset " invoke" begin
336
+ fr = JuliaInterpreter. enter_call (f_inv, 2 )
337
+ fr, pc = JuliaInterpreter. debug_command (fr, :s ) # apply_type
338
+ frame, pc = JuliaInterpreter. debug_command (fr, :s ) # step into invoke
339
+ @test frame. framecode. scope. sig == Tuple{typeof (f_inv),Real}
340
+ JuliaInterpreter. debug_command (frame, :c )
341
+ frame = root (frame)
342
+ @test get_return (frame) == f_inv (2 )
331
343
end
332
344
333
345
@testset " Issue #178" begin
0 commit comments