# Debugger - Treat specific functions as compiled in package

**URL:** <https://discourse.julialang.org/t/debugger-treat-specific-functions-as-compiled-in-package/124802>\
**Category:** General Usage\
**Tags:** question, debugging, vscode, debugger\
**Created:** [January 15, 2025, 5:48pm UTC](https://discourse.julialang.org/t/debugger-treat-specific-functions-as-compiled-in-package/124802 "2025-01-15T17:48:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![p\_f](https://avatars.discourse-cdn.com/v4/letter/p/45deac/32.png) [@p\_f](https://discourse.julialang.org/u/p_f)\
**Post date:** [January 15, 2025, 5:48pm UTC](https://discourse.julialang.org/t/debugger-treat-specific-functions-as-compiled-in-package/124802/1 "2025-01-15T17:48:02Z")

</div>

Motivated by [Extremely slow debugging in VS Code](https://discourse.julialang.org/t/extremely-slow-debugging-in-vs-code/124762), I have become invested in understanding the VSCode debugger.

Is it possible to effectively treat particular functions in my package as compiled?

For example, consider my package with function `F` that calls `f1` and `f2`. I want to debug function `F`, but treat `f2` as compiled.

Here is the module:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/4/0/40d48a6f3589d774607f8ef9a3046b48a3c17e87.png)  
Note I have a breakpoint on every line for now.

**Attempt 1:**

If I add `ALL_MODULES_EXCEPT_MAIN`, `-testpkg.F`, and `-testpkg.f1`, my “Julia: Compiled Code” looks like this:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/c/4/c428ab3dc65fb283cfca130a248fb029529cfb24.png)

But this is the result:

```julia
@run F() #stops only at breakpoints in F
@run f1(1.0) #stops at breakpoint
@run f2(1.0) #does not stop

```

I would expect the breakpoints in `F` and `f1` to work because I’ve specified those as interpreted, but not the one in `f2` (so we’re halfway there).

If I disable the breakpoints in function `F`, things work better:

```julia
@run F() #stops at breakpoint in f1 and NOT f2
@run f1(1.0) #stops at breakpoint
@run f2(1.0) #does not stop

```

**Attempt 2:**

If instead I set up my “Julia: Compiled Code” like this, by adding `ALL_MODULES_EXCEPT_MAIN`, `-testpkg`, `testpkg.f2`:

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

In my mind this is equivalent to before, but I get different behaviour:

```julia
@run F() #stops at every breakpoint
@run f1(1.0) #stops at breakpoint
@run f2(1.0) #does not stop

```

and then removing the breakpoints in `F`:

```julia
@run F() #stops at both breakpoints in f1 and f2
@run f1(1.0) #stops at breakpoint
@run f2(1.0) #does not stop

```

* * *

So it seems that whether `f2` is compiled or not depends on the setup of “Julia: Compiled Code”, which breakpoints are set, and whether `f2` is called directly or in the function `F`. Am I doing something wrong here? Am I using the correct approach to compile/interpret particular functions?
