Debug the template using GDB via west commands:
# Attach GDB, skip rebuilding application
west attach --skip-rebuild
Common GDB commands:
(gdb) tui enable
(gdb) monitor reset
(gdb) break main
(gdb) continue
(gdb) backtrace
(gdb) print variable_name
(gdb) next
(gdb) step
For more information, see the following documentation: