
Stopping and Continuing
Motorola
GNU Debugger (GDB)
For More Information On This Product,
Go to: www.freescale.com
D-25
D.6.3 Continuing
After your program stops, most likely you will want it to run some more if the bug you are
looking for has not happened yet.
cont
Continue running the program at the place where it stopped.
If the program stopped at a breakpoint, the place to continue running is the address of the
breakpoint. You might expect that continuing would just stop at the same breakpoint
immediately. In fact, ‘cont’ takes special care to prevent that from happening. You do not
need to delete the breakpoint to proceed through it after stopping at it.
You can, however, specify an ignore-count for the breakpoint that the program stopped at,
by means of an argument to the ‘cont’ command. See section Conditions.
If the program stopped because of a signal other than SIGINT or SIGTRAP, continuing
will cause the program to see that signal. You may not want this to happen. For example,
if the program stopped due to some sort of memory reference error, you might store
correct values into the erroneous variables and continue, hoping to see more execution;
but the program would probably terminate immediately as a result of the fatal signal once
it sees the signal. To prevent this, you can continue with ‘signal 0’. See section Signaling.
You can also act in advance to prevent the program from seeing certain kinds of signals,
using the ‘handle’ command (see section Signals).
D.6.4 Stepping
Stepping
means setting your program in motion for a limited time, so that control will
return automatically to the debugger after one line of code or one machine instruction.
Breakpoints are active during stepping and the program will stop for them even if it has
not gone as far as the stepping command specifies.
Table D-8. Stepping Commands
Command
Description
step
Continue running the program until control reaches a different line, then stop it and return
control to the debugger. This command is abbreviated ‘s’.
This command may be given when control is within a function for which there is no debugging
information. In that case, execution will proceed until control reaches a different function, or is
about to return from this function. An argument repeats this action.
step count
Continue running as in ‘step’, but do so count times. If a breakpoint is reached or a signal not
related to stepping occurs before count steps, stepping stops right away.
F
Freescale Semiconductor, Inc.
n
.