Skip to content

Commit 65f3c3d

Browse files
authored
Merge pull request #47 from JuliaDebug/teh/debugging
Make it easier to create useful bug reports from Julia tests
2 parents 7705307 + 488b7a8 commit 65f3c3d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/utils.jl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,8 @@ function run_test_by_eval(test, fullpath, nstmts)
172172
stack = JuliaStackFrame[]
173173
for (i, modex) in enumerate(modexs) # having the index can be useful for debugging
174174
nstmtsleft = $nstmts
175+
# mod, ex = modex
176+
# @show mod ex
175177
frame = JuliaInterpreter.prepare_thunk(modex)
176178
while true
177179
yield() # allow communication between processes
@@ -198,3 +200,17 @@ function run_test_by_eval(test, fullpath, nstmts)
198200
return ts, aborts
199201
end))
200202
end
203+
204+
# To help debugging
205+
function run_compiled(frame)
206+
Core.eval(moduleof(frame), Expr(:toplevel, quote
207+
let pc = $frame.pc[]
208+
while true # This is finish!, except we need to run it at top level
209+
new_pc = ($_step_expr!)($(Compiled()), $frame, pc, true)
210+
new_pc == nothing && break
211+
pc = new_pc
212+
end
213+
$frame.pc[] = pc
214+
end
215+
end))
216+
end

0 commit comments

Comments
 (0)