Refer: (Quick guide)
Intro:
GDB (Step by Step Introduction) - GeeksforGeeks
Advanced:
GDB, the GNU Debugger, is a powerful command-line tool for debugging programs. It allows you to step through code, set breakpoints, examine variables, and more. To use it, compile your code with the
-g
flag (e.g.,
gcc -g main.c -o main
) and then run
gdb <executable_name>
. Common commands include
break
,
run