Call stack

You can also show the current call stack with v.debug.

To enable this feature, add the -d callstack switch when building or running your code:

import v.debug fn test(i int) { if i > 9 { debug.dump_callstack() } } fn do_something() { for i := 0; i <= 10; i++ { test(i) } } fn main() { do_something() }
$ v -d callstack run example.v
Backtrace:
--------------------------------------------------
example.v:16   | > main.main
example.v:11   |  > main.do_something
example.v:5    |   > main.test
--------------------------------------------------