Debugging with threads

I have code which spawns some threads with tasks = [Threads.@spawn worker(command, ml, ev) for i in 1:nT]. I put a breakpoint inside the worker() function using VSCode and started a higher level function with @enter from the julia console within VSCode. But the debugger never stops at the breakpoint, even though the code runs to completion.

I speculate that the debugger is not active in threads.

Is there anyway I can debug stuff that happens outside my main thread?

BTW, the code blocks if I try to run it all in one thread; there are ways around that for testing, but it would be convenient if the debugger worked for threads.

This is just not implemented. The first step would be Support for debugging tasks · Issue #413 · JuliaDebug/JuliaInterpreter.jl · GitHub, and then we would have to make the debugger thread safe :slight_smile: