# De-bugging method

**URL:** <https://discourse.julialang.org/t/de-bugging-method/109852>\
**Category:** General Usage\
**Tags:** question, package, debug\
**Created:** [February 7, 2024, 4:06am UTC](https://discourse.julialang.org/t/de-bugging-method/109852 "2024-02-07T04:06:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lincoln\_Hannah](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lincoln_hannah/32/19198_2.png) [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)\
**Post date:** [February 7, 2024, 4:06am UTC](https://discourse.julialang.org/t/de-bugging-method/109852/1 "2024-02-07T04:06:10Z")

</div>

I like to execute code line by line with CTRL/SHIFT +Enter (rather than F5 Debug)  
I often begin a function with two lines of the form

```julia
 global X = (; function_inputs )
(; function_inputs) = X

```

So if an error occurs I can run the second line to recover the function inputs, then run line by line with CTRL+Enter.

Is it possible to recover the function inputs without these two lines?

---

<div class="post-metadata">

**Author:** ![SteffenPL](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/steffenpl/32/206270_2.png) [@SteffenPL](https://discourse.julialang.org/u/SteffenPL)\
**Post date:** [February 7, 2024, 5:30am UTC](https://discourse.julialang.org/t/de-bugging-method/109852/2 "2024-02-07T05:30:31Z")

</div>

It sounds a bit like [Debugging code from the REPL](https://www.julia-vscode.org/docs/stable/userguide/debugging/#Debugging-code-from-the-REPL).

But it seems that whatever you do, you need to manually mark those functions where you want to be able to recover the inputs from. (Obviously, Julia cannot keep a history of all inputs from all functions.)

Following your style, you could probably define a macro such that functions are defined like `@track f(x) = x^2` will automatically track their input history somewhere…
