Debugging with GDB
Step through C programs, inspect variables and find crashes.
Easy
gcc -g -O0 app.c -o app
gdb ./app
(gdb) break main
(gdb) run
(gdb) next / step / print x / backtrace
With OpenOCD or a J-Link, GDB debugs microcontrollers too.
Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.
Discussion (0)
Sign in or join free to ask questions and discuss this topic.