Debugging techniques for AkiraOS development.
Logging
Enable Debug Logs
CONFIG_LOG_DEFAULT_LEVEL=4 # DEBUG
Runtime Log Control
uart:~$ log enable akira 4
uart:~$ log enable wasm 4
uart:~$ log list
GDB Debugging (Native Sim)
# Build with debug symbols
west build -b native_sim -- -DCMAKE_BUILD_TYPE=Debug
# Run under GDB
gdb ../build/zephyr/zephyr.exe
(gdb) break main
(gdb) run
JTAG Debugging (ESP32-S3)
# OpenOCD + GDB
west debug
Core Dumps
Enable core dumps on crash:
CONFIG_DEBUG_COREDUMP=y
CONFIG_DEBUG_COREDUMP_BACKEND_LOGGING=y
Memory Debugging
Check Stack Usage
uart:~$ kernel stacks
uart:~$ kernel threads
Enable Stack Canaries
CONFIG_STACK_CANARIES=y