# VSCode Debugger Compiled Mode Button Clarification

**URL:** <https://discourse.julialang.org/t/vscode-debugger-compiled-mode-button-clarification/97375>\
**Category:** Tooling\
**Tags:** debugging, vscode\
**Created:** [April 12, 2023, 2:22am UTC](https://discourse.julialang.org/t/vscode-debugger-compiled-mode-button-clarification/97375 "2023-04-12T02:22:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TI36XPro](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ti36xpro/32/33658_2.png) [@TI36XPro](https://discourse.julialang.org/u/TI36XPro)\
**Post date:** [April 12, 2023, 2:22am UTC](https://discourse.julialang.org/t/vscode-debugger-compiled-mode-button-clarification/97375/1 "2023-04-12T02:22:54Z")

</div>

I noticed there is a red button that only appears when you hover over the “Julia: Compiled Code” (see image below). The tooltip says it runs Julia in compiled mode. So once you’ve clicked it, it runs _all_ the code (including my own) in compiled mode which seems to make debugger pointless (breakpoints no longer work in any of the code). So I’m not sure why you’d ever use this button. Am I missing something?

Also - right now if you click it there is no indication (that I could see, possible I missed something) it is turned “on” or “off” (just stays a red button).

![image](https://global.discourse-cdn.com/julialang/original/3X/a/2/a2592b2c7e5796f18e0ed745d4bb989d42306ab3.png)

---

<div class="post-metadata">

**Author:** ![disberd](https://avatars.discourse-cdn.com/v4/letter/d/8edcca/32.png) [@disberd](https://discourse.julialang.org/u/disberd)\
**Post date:** [April 12, 2023, 7:45am UTC](https://discourse.julialang.org/t/vscode-debugger-compiled-mode-button-clarification/97375/2 "2023-04-12T07:45:00Z")

</div>

I was also puzzled at first when I saw this feature, but it can be convenient to be able to toggle full compiled mode on in some cases.

For example assume you have the following function that is called from your main script/function

```julia
function middle_function()
# Some lines of code
bp_1 # <- the first breakpoint you have
# Other lines
inner_function() # <- A call to an inner function that you also contains breakpoints
# Other lines
bp_2 # <- Your second breakpoint
# Other lines
end

```

and in this specific debugging instance you want to just check the status of the variables inside `middle_function` either at `bp_1` or at `bp_2`, you are not interested for the time beeing in stopping at the breakpoints defined inside `inner_function` or any other breakpoint that are encountered in other functions called from there.

The toggle allows you to run until `bp_1`, activate compiled mode, press continue and find yourself directly at `bp_2` without stopping inside breakpoints of `inner_function`.

Without this toggle you’d have to manually disable/toggle the various breakpoints that are encountered inside `inner_function` and you’d also potentially face speed penalties when running things inside `inner_function` not in compiled mode.

The functionality has its uses, the big problem is that that button is [broken](https://github.com/julia-vscode/julia-vscode/issues/3234) and once it’s pressed it will always keep in you compiled mode without allowing you to switch it back off.

Until the issue above is fixed, you can still toggle the compiled mode directly calling the related commands from the command palette in vscode:  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/4/a/4ac08b26bc78a9aea1d2d1e055b34ec12c0c792a.png)

I believe the shortcut you see above for disabling the compiled mode is not assigned by default in the extension and I just added it to my configuration file.

---

<div class="post-metadata">

**Author:** ![TI36XPro](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ti36xpro/32/33658_2.png) [@TI36XPro](https://discourse.julialang.org/u/TI36XPro)\
**Post date:** [April 12, 2023, 1:37pm UTC](https://discourse.julialang.org/t/vscode-debugger-compiled-mode-button-clarification/97375/3 "2023-04-12T13:37:23Z")

</div>

The interactive use case did not even occur to me. Now it totally makes sense. Thank you!
