LOGBOOK

HELP

Quiz Entry - updated: 2026.12.01

Once GDB has stopped in app_main, which basic commands let you look around and move through the program?

list shows source, break sets breakpoints, next steps over one line, step steps into a call, continue runs to the next breakpoint, print shows a variable, bt shows the call stack and info threads lists the FreeRTOS tasks.

Command (short form) What it does
list (l) Show source lines around the current position.
break hello_world_main.c:18 (b) Stop whenever execution reaches that line. break app_main takes a function name.
next (n) Run the current line and stop at the next one. A function call on that line is run completely.
step (s) Like next, but enter a called function and stop at its first line.
continue (c, cont) Run until the next breakpoint, or until Ctrl+C halts the chip.
print chip_info (p) Show the value of a variable or expression.
bt Backtrace: the chain of function calls that led here.
info threads, thread 2 List the FreeRTOS tasks and switch to one of them.
delete 2 (d) Remove breakpoint number 2.
mon reset halt Ask OpenOCD to reset the chip and stop it again.

A typical first session: list to see where you are, break 18 to stop just after the greeting, next to run the printf and see Hello world! appear in the monitor terminal, then cont to let the program continue.

Pressing Enter on an empty line repeats the last command, which is handy for repeated next. Remove breakpoints you no longer need: beyond the first two, each one in flash code is emulated by rewriting flash, which makes stepping noticeably slower.

Tip: Halting the CPU also stops FreeRTOS's timers and the Wi-Fi stack. A connection can drop while the program is paused, so a timeout after a long pause is often caused by the pause and not by the code.

Go deeper:

From Quiz: SIOT / JTAG Debugging with OpenOCD and GDB | Updated: Dec 01, 2026