Next: , Previous: Setting a breakpoint, Up: Compiling for debugging


5.4 Stepping through the program

To move forward and execute the line displayed above, use the command step:

     (gdb) step
     7         return foo (p);

After executing line 6, the debugger displays the next line to be executed. The pointer p will now have been set to zero (null):

     (gdb) print p
     $1 = (int *) 0x0

The command step will follow the execution of the program interactively through any functions that are called in the current line. If you want to move forward without tracing these calls, use the command next instead.