Previous Topic Next topic Print topic


Step

Use

Executes a specified number of statements.

Command Syntax

STEP [OUT]
     [IN|OVER]
     [count]
     [[action-list]]

where:

count
Is an integer specifying the number of statements to be executed

Description

action-list specifies a set of one or more CodeWatch commands separated by semicolons.

The STEP command starts program execution at the current location of the execution pointer and stops execution after one or a specified number of statements.

To execute a single statement, use Step with no options specified. To execute a number of statements, specify a count parameter.

If Step Out is specified, the debugger steps to the exit point of the current routine. If Step Out is specified with a count parameter, the first step is to the exit point of the current routine, and each step thereafter is to a succeeding statement in the calling routine. Thus, if the execution pointer is in a called routine and you want to step to the next executable statement in the calling routine, issue STEP OUT 2. The first step is to the exit point of the current routine, and the second step returns and steps forward in the calling routine. If the execution pointer is already at the exit point of the called routine, issuing Step Out causes the execution pointer to step to the exit point of the calling routine.

If Step In is specified and the current execution point is at a subroutine call, the debugger steps to the entry point of the called routine. If Step In is specified with a count parameter, the entry point is the first step, the first executable statement is another, and so on.

If Step Over is specified, the debugger steps over calls to routines. Step Over is the default mode for the STEP command.

If an action-list is present, it is performed at the last step and is set as the action to be taken for any other Step. To remove the Step action-list, supply a null action-list as an argument to Step. Use the DSTEP command to do this without stepping.

At the completion of a step operation, the debugger issues a message indicating the current execution point in the following format:

Step at x

where x is the location of the current execution point, that is, the statement that is about to be executed.

Note:

Step cannot be used when the current execution point of the user program is at a non-local Goto.

Example

In the following example, the default stepping mode is set to step in and the stepping action-list is set to print the current source line. Two step commands are executed (the second command with a count of 2).

CodeWatch> DSTEP IN [P] 
CodeWatch> STEP
Step at PRIMES.SIFT\95
  95: primes(count) = this_prime;
CodeWatch> S 2
Step at PRIMES.SIFT\97 
  97: do while (k < n);

In the following example, the debugger steps out of the sift routine.

CodeWatch> STEP OUT
Number of primes found was (prime) 5

1  2  3    5  7

Step at PRIMES.SIFT\%EXIT 
  106: end sift;
Previous Topic Next topic Print topic