Debugger does not step over quoted macro code in VS Code

I would like to know how other people use the debugger with code that uses the logging macros. For me it is almost unusable, since the debugger steps into every logging call, e.g. @debug, @info, .... Every time I have to press the Step-Over-Button many times to get back to my own code. The Step-Out-Button skips to far and steps out of my own function, that called the macro, so I can’t see what happens after.

I did play around with the “Compiled Code” list in the debug panel. I made sure that my own fully qualified macro names as well as the CoreLogging ones are listed as ‘compiled’. And indeed the code that runs in the macro is skipped, BUT the quoted code returned from the macro is treated as inlined into my functions. I don’t want that and can’t debug my own code if it is interrupted like this. This really breaks my concentration. I wish macro calls would be handled the same way as function calls where pressing Step-Over never shows you the function/macro body.

Do you have the same issue? Maybe I am using the tools wrong or there are workarounds, let me know please.


Sorry for the troubles. I am not sure there’s a generic solution. With Debugger.jl, a slightly more complicated function

julia> function debug_demo()
           i = rand()
           @info i
           i = rand()
       end

(one which has function calls rather than just variable assignments) works reasonably well if you use 'u' (advance to the next higher line number in the same file) rather than 'n' (advance to the next line) for stepping.

The same works in VS Code if you use the “Run to Cursor” command:

1 Like

Thanks to both of you. Good to see that there are more finer controls in Debugger.jl

‘Run to Cursor’ does the trick. I had the feeling that there must be another way to use the debugger in cases like this. You will save me a lot of nerves. Thank you for showing me.