Using VSCode and the following test code, with a breakpoint set where indicated:
function test5(x)
a=10 #set breakpoint here
return a+x
end
print(sum(test5(x) for x in [3, 5]))
When I run this with F5
the code executes and prints 28, but it never stops.
My theory is that sum
is compiled code and the breakpoints don’t fire in code called from compiled code.
Can anyone confirm this explanation, or provide another one?
Is there any good way around this, i.e., by doing something other than disabling the “compiled code” feature of the debugger, which would like make it too slow?
I formed the theory after many breakpoints failed to cause a break, and I noticed they fit this pattern. It’s really frustrating and weird to set breakpoints and discover that they don’t work.
There have been many other reports of breakpoints failing to work, in at least the following contexts:
- used while running test suite
- used outside of top level
- used in an include file
- used outside main thread
- used in a callback
but I didn’t see this particular scenario mentioned, aside from someone suggesting compiled code might play a role in some of the difficulties.
Julia 1.8.5, VSCode julia extension 1.38.2.