
D-26
Motorola DSP56000 Family Optimizing C Compiler User’s Manual
For More Information On This Product,
Go to: www.freescale.com
Motorola
Stopping and Continuing
next
Similar to ‘step’, but any function calls appearing within the line of code are executed without
stopping. Execution stops when control reaches a different line of code at the stack level
which was executing when the ‘next’ command was given. This command is abbreviated ‘n’.
An argument is a repeat count, as in ‘step’.
‘next’ within a function without debugging information acts as does ‘step’, but any function
calls appearing within the code of the function are executed without stopping.
finish
Continue running until just after the selected stack frame returns (or until there is some other
reason to stop, such as a fatal signal or a breakpoint). Print value returned by the selected
stack frame (if any).
Contrast this with the ‘return’ command (see section Returning).
until
This command is used to avoid single stepping through a loop more than once. It is like the
‘next’ command, except that when ‘until’ encounters a jump, it automatically continues
execution until the program counter is greater than the address of the jump.
This means that when you reach the end of a loop after single stepping though it, ‘until’ will
cause the program to continue execution until the loop is exited. In contrast, a ‘next’ command
at the end of a loop will simply step back to the beginning of the loop, which would force you
to step through the next iteration.
‘until’ always stops the program if it attempts to exit the current stack frame.
‘until’ may produce somewhat counterintuitive results if the order of the source lines does not
match the actual order of execution. For example, in a typical C for-loop, the third expression
in the for-statement (the loop-step expression) is executed after the statements in the body of
the loop, but is written before them. Therefore, the ‘until’ command would appear to step back
to the beginning of the loop when it advances to this expression. However, it has not really
done so, not in terms of the actual machine code.
Note that ‘until’ with no argument works by means of single instruction stepping, and hence is
slower than ‘until’ with an argument.
until location
Continue running the program until either the specified location is reached, or the current
(innermost) stack frame returns. This form of the command uses breakpoints, and hence is
quicker than ‘until’ without an argument.
stepi
si
Execute one machine instruction, then stop and return to the debugger.
It is often useful to do ‘display/i $pc’ when stepping by machine instructions. This will cause
the next instruction to be executed to be displayed automatically at each stop. See section
Auto Display.
An argument is a repeat count, as in ‘step’.
nexti
ni
Execute one machine instruction, but if it is a subroutine call, proceed until the subroutine
returns.
An argument is a repeat count, as in ‘next’.
A typical technique for using stepping is to put a breakpoint (see section Breakpoints) at the
beginning of the function or the section of the program in which a problem is believed to lie,
and then step through the suspect area, examining the variables that are interesting, until the
problem happens.
The ‘cont’ command can be used after stepping to resume execution until the next breakpoint
or signal.
Table D-8. Stepping Commands (Continued)
Command
Description
F
Freescale Semiconductor, Inc.
n
.