You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/userguide/debugging.md
+27-2Lines changed: 27 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -119,7 +119,32 @@ Click on the Debugger Default Compiled extension setting.
119
119
120
120

121
121
122
-
Configure this setting as in the picture bellow.
123
-
`ALL_MODULES_EXCEPT_MAIN` will make everything run in compiled mode except for Main. We also use "-Statistics." to remove this package from the list of compiled modules, such that it will be interpreted.
122
+
Configure this setting as follows.
123
+
```
124
+
"julia.debuggerDefaultCompiled": [
125
+
"ALL_MODULES_EXCEPT_MAIN",
126
+
"-Statistics.",
127
+
]
128
+
```
129
+
`ALL_MODULES_EXCEPT_MAIN` will make all modules run in compiled mode except the Main module, which contains the code you wrote. We also use "-Statistics." to remove this module and all its submodules from the list of compiled modules, such that it will be interpreted.
130
+
131
+
### Use a custom sys image
132
+
Custom julia sys images can also be used when debugging. Go to julia-vscode extension settings and click to edit "Additional Args".
124
133
125
134

135
+
136
+
137
+
Once in the settings, use "-J" option followed by your path to the custom sys image. Note this "Additional Args" settings are currently used only when debugging in the REPL mode, see the `@run` macron in the example bellow.
138
+
```
139
+
"julia.additionalArgs": [
140
+
"-JC:\\temp\\sys_custom.so",
141
+
],
142
+
```
143
+
### Example for fast(er) debugging
144
+
In the following code we use the packages GLMakie and Statistics. GLMakie is a plotting package and it's known to have a pretty slow time-to-first-plot(TTFP), especially for julia versions older than 1.9. Interpretting GLMakie is definetely not a thing we want to do when debugging. With the settings above, GLMakie is set to run in compile mode and we also load it from the sys image. Make sure you use the `@run` macro with your root function and debugg in the REPL mode.
145
+
146
+

147
+
148
+
As the debugger hits the desired line of code we can step inside the `mean` function (Statistics) and debug there.
0 commit comments