Skip to content

Commit a73db8a

Browse files
committed
complete the fast debugging example
1 parent 245949f commit a73db8a

File tree

4 files changed

+27
-2
lines changed

4 files changed

+27
-2
lines changed

docs/src/assets/debugger/17.png

295 Bytes
Loading

docs/src/assets/debugger/18.png

40.2 KB
Loading

docs/src/assets/debugger/19.png

50.6 KB
Loading

docs/src/userguide/debugging.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,32 @@ Click on the Debugger Default Compiled extension setting.
119119

120120
![Debugger](../assets/debugger/16.png)
121121

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".
124133

125134
![Debugger](../assets/debugger/17.png)
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+
![Debugger](../assets/debugger/18.png)
147+
148+
As the debugger hits the desired line of code we can step inside the `mean` function (Statistics) and debug there.
149+
150+
![Debugger](../assets/debugger/19.png)

0 commit comments

Comments
 (0)