# Debugger enters a second level of the same function

**URL:** <https://discourse.julialang.org/t/debugger-enters-a-second-level-of-the-same-function/59979>\
**Category:** New to Julia\
**Created:** [April 25, 2021, 9:21am UTC](https://discourse.julialang.org/t/debugger-enters-a-second-level-of-the-same-function/59979 "2021-04-25T09:21:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![conditionality](https://avatars.discourse-cdn.com/v4/letter/c/4af34b/32.png) [@conditionality](https://discourse.julialang.org/u/conditionality)\
**Post date:** [April 25, 2021, 9:21am UTC](https://discourse.julialang.org/t/debugger-enters-a-second-level-of-the-same-function/59979/1 "2021-04-25T09:21:20Z")

</div>

Hi,

I’m curious about why the debugger behaves as it does in the following case. I’m debugging the file [https://github.com/FluxML/model-zoo/blob/master/vision/vae\_mnist/vae\_mnist.jl](https://github.com/FluxML/model-zoo/blob/master/vision/vae_mnist/vae_mnist.jl) and I’m putting a breakpoint at row 94 (args = Args(; kws…)). The call stack looks as expected “Main → train”. However, when I step forward (i.e. execture “Args(; kws…)”), the call stack becomes “Main → train → #train#10”, **where does this new level come from?** Furthermore, it seems like I am stuck in this extra frame:  
I have a second breakpoint at row 107 (loader = get\_data(args.batch\_size)) but I cannot reach that breakpoint. As soon as I hit row 100 (@info “Training on GPU”) the debugger enters file logging.jl#350 (\*) and I am never (\*\*) able to return to the breakpoint of row 107.

(\*) This is probably the same issue as: [https://github.com/julia-vscode/julia-vscode/issues/1667](https://github.com/julia-vscode/julia-vscode/issues/1667)

(\*\*) Note that I’m not sure if “never” is because of super slow debugger or because of some weird reason such as breakpoint being set in frame “train” but since I’m stuck in frame “#train#10” it never actually hits it (I don’t really know how debuggers work).  
I’m using Julia 1.6.1

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [April 25, 2021, 9:28am UTC](https://discourse.julialang.org/t/debugger-enters-a-second-level-of-the-same-function/59979/2 "2021-04-25T09:28:12Z")

</div>

> [@conditionality](#):
>
> **where does this new level come from?**

Julia sometimes internally defines multiple “versions” of a function. When it comes to keyword functions there is first a function that “sorts” the keyword arguments and then passes the result on to a generated inner function that does the actual computation. From the debuggers point of view, these look like two separate function even though the user only wrote one function.

Keyword functions have in general been quite tricky to handle completely satisfactory in the debugger.
