Once the program has hit a breakpoint, it can be run step by step using one of the following commands:
next, also available with the abbreviation n: executes
the program until the next line of the current function.
This instruction can take an integer parameter to say how many times
we want it to be repeated. For instance, next 4 will move 4
lines forward in the execution of the program.
step, or s: executes the program until the next source
line is reached. If a function with debugging information is called,
step will descend into this funciton.
continue, or cont: continue until the program hits another
breakpoint. This command does also take an optional integer argument
that tells how many times the commmand should be repeated.
finish, or fin: continue until the current function
returns to the caller, and show the value returned.
Gdb allows you to examine a program's call stack whether the program
is stopped due to a breakpoint, stopped in abort(), or frozen in
a core file.
bt or where: print the program's stack trace
frame or f: select a frame within the stack. You can
examine local variables within the selected frame using print.
up: selects the frame the previously selected frame was
called from
down: selects the frame the previously selected frame calls.