Debugger.jl halted on the line of JSON.parse()

I tested Debugger using Julia1.3 and Julia 1.2. I use command n to debug line by line. When it encounter the line using JSON.jl package. VS running a long time and halted there, and can not go to the next line. The demo code is as follows.

using JSON

function f()
f_path = raw"C:\test.json"
txt = read( f_path , String )
vessel_char = JSON.parse( txt ) ## stopped here, and vs code has no response

return c 


d = f()

Note that the debugger is slow because by default it runs code in interpreted mode. Especially for something like reading a large file, this might make things more or less unusable.

There is a feature to use a compiled mode for some steps. You could try to switch to compiled mode for the step over JSON.parse(text). That means no breakpoint in parse or the functions it calls would be hit, but you might be able to step over that line in reasonable time.

In the VS Code alpha you can switch mode in the breakpoint list view, and you can change it whenever the debugger is paused. Not entirely sure how that works in Debugger.jl, but I’m sure one can do the same thing there as well.

1 Like

Thanks! Thank you for great efforts on Julia-vscode. I just tested Julia-vscode 0.15-alpha7. It is extremely convenient, clear, and stable compared with JUNO. Similar experience as the IDE debuggers for Python and C++. It would be the first IDE with usable debugger function according to my experience. Waiting for the final release version of Julia-vscode v0.15, which would be a game-changer of Julia IDE.

1 Like

Awesome, thanks so much for the feedback! Please do stress test it, I literally just coded it up in one go, and very few folks have tested it at all, so it must be full of bugs right now :wink: But it is ready for feedback, so anything you find is much appreciated!

1 Like

I select Enable compile mode, it works. It can be used now, although speed on the code using third-party package is still slow, event for the code using Core functions such as read(), println(), which would be the problem of Debugger.jl (Some time the speed is not so slow and hope it would be solved in the final release version). I tested using a big Julia project for my work. It works, although the speed is still a bit slow.
Julia-vscode is the most stable IDE ,except for the command-based ones, according to my years’ experience. VS code saved me a lot of time. Thanks!

1 Like