Step, Next, and Breakpoints

Learn what step, next, and breakpoints are.

As we execute the program, we can step through the program one line or function at a time. We can also set conditional and unconditional breakpoints in the program.

Breakpoints

Breakpoints are used to break execution at a specified line, function, or file. If you want to set up a breakpoint at line 6, enter the following command in the gdb mode:

gdb) break 6
gdb) run

📝 Note: We can also add conditional breakpoints.

Get hands-on with 1400+ tech skills courses.