@@ -9,6 +9,18 @@ function step_through(frame)
9
9
return get_return (r)
10
10
end
11
11
12
+ function step_through_function (f, args... )
13
+ frame = JuliaInterpreter. enter_call (f, args... )
14
+ while true
15
+ ret = JuliaInterpreter. debug_command (JuliaInterpreter. finish_and_return!, frame, " s" )
16
+ ret == nothing && break
17
+ frame, pc = ret
18
+ end
19
+ @test frame. callee === nothing
20
+ @test frame. caller === nothing
21
+ return JuliaInterpreter. get_return (frame)
22
+ end
23
+
12
24
@generated function generatedfoo (T)
13
25
:(return $ T)
14
26
end
@@ -49,14 +61,17 @@ struct B{T} end
49
61
50
62
f22 () = string (:(a+ b))
51
63
@test step_through (enter_call (f22)) == " a + b"
64
+ @test step_through_function (f22) == " a + b"
52
65
f22 () = string (QuoteNode (:a ))
53
66
@test step_through (enter_call (f22)) == " :a"
67
+ @test step_through_function (f22) == " :a"
54
68
55
69
frame = enter_call (trivial, 2 )
56
70
@test debug_command (frame, " s" ) === nothing
57
71
@test get_return (frame) == 2
58
72
59
73
@test step_through (enter_call (trivial, 2 )) == 2
74
+ @test step_through_function (trivial, 2 ) == 2
60
75
@test step_through (enter_call_expr (:($ (+ )(1 ,2.5 )))) == 3.5
61
76
@test step_through (enter_call_expr (:($ (sin)(1 )))) == sin (1 )
62
77
@test step_through (enter_call_expr (:($ (gcd)(10 ,20 )))) == gcd (10 , 20 )
@@ -207,6 +222,7 @@ struct B{T} end
207
222
end
208
223
B_inst = B {Int} ()
209
224
step_through (JuliaInterpreter. enter_call (B_inst, 10 )) == B_inst (10 )
225
+ step_through_function (B_inst, 10 ) == B_inst (10 )
210
226
end
211
227
212
228
@testset " Exceptions" begin
0 commit comments