Continuing means resuming program execution until your program completes normally. In contrast, stepping means executing just one more "step" of your program, where "step" may mean either one line of source code, or one machine instruction (depending on what particular command you use).
Either when continuing or when stepping, your program may stop even sooner, due to a breakpoint or a signal. (If due to a signal, you may want to use handle, or use signal 0 to resume execution. See "Signals.")
The argument ignore-count is meaningful only when your program stopped due to a breakpoint. At other times, the argument to continue is ignored.
The synonyms c and fg are provided purely for convenience, and have exactly the same behavior as continue.
To resume execution at a different place, you can use return (see "Returning from a function") to go back to the calling function; or jump (see "Continuing at a different address") to go to an arbitrary location in your program.
A typical technique for using stepping is to set a breakpoint (see "Breakpoints, watchpoints, and exceptions") at the beginning of the function or the section of your program where a problem is believed to lie, run your program until it stops at that breakpoint, and then step through the suspect area, examining the variables that are interesting, until you see the problem happen.
The step command stops only at the first instruction of a source line. This prevents multiple stops in switch statements, for loops, etc. The step command stops if a function that has debugging information is called within the line.
Also, the step command enters a subroutine only if there's line number information for the subroutine. Otherwise it acts like the next command.
The count argument is a repeat count, as for step.
The next command stops only at the first instruction of a source line. This prevents the multiple stops in switch statements, for loops, etc.
Contrast this with the return command (see "Returning from a function").
This means that when you reach the end of a loop after single-stepping though it, until makes your program continue execution until it exits the loop. In contrast, a next command at the end of a loop simply steps back to the beginning of the loop, which forces you to step through the next iteration.
The until command always stops your program if it attempts to exit the current stack frame.
The until command may produce somewhat counterintuitive results if the order of machine code doesn't match the order of the source lines. For example, in the following excerpt from a debugging session, the f (frame) command shows that execution is stopped at line 206; yet when we use until, we get to line 195:
(gdb) f #0 main (argc=4, argv=0xf7fffae8) at m4.c:206 206 expand_input(); (gdb) until 195 for ( ; argc > 0; NEXTARG) {
This happened because, for execution efficiency, the compiler had generated code for the loop closure test at the end, rather than the start, of the loop—even though the test in a C for-loop is written before the body of the loop. The until command appeared to step back to the beginning of the loop when it advanced to this expression; however, it hasn't really gone to an earlier statement—not in terms of the actual machine code.
An until command with no argument works by means of single instruction stepping, and hence is slower than until with an argument.
It's often useful to do display/i $pc when stepping by machine instructions. This makes GDB automatically display the next instruction to be executed, each time your program stops. See "Automatic display."
The count argument is a repeat count, as in step.
The count argument is a repeat count, as in next.