Everything
2.11.3 Execute programs in steps

When either of the following operation has occurred, the program will stop automatically after conducting step execution in the source level (1 line of source text) or in the instruction level (1 instruction).

Once the program is stopped, the contents of each panel will be updated automatically. As such, step execution is suited for debugging the program execution in transition either in source or instruction level.

The unit in which the program is step-executed depends on the setting as follows:

 

-

When the button on the Editor panel’s toolbar is invalid (default):

Step execution is conducted in source level.

Note, however, that when the focus is in the Disassemble panel or the line information does not exist in the address specified by the current PC value, the step execution is conducted in instruction level.

 

-

When the button on the Editor panel’s toolbar is valid:

Step execution is conducted in instruction level.

Caution

The button is only enabled if the Mixed display mode is selected on the Editor panel.

 

Step execution is divided into the following types:

 

2.11.3.1 Step in function (Step in execution)

2.11.3.2 Step over function (Step over execution)

2.11.3.3 Execute until return is completed (Return out execution)

Caution 1.

Breakpoints, break events, and action events that have been set do not occur during step execution.

Caution 2.

An error message will appear while processing a function prologue or epilogue if the return address cannot be acquired.

Caution 3.

[Full-spec emulator][E1][E20]

-

Interrupts are not acknowledged during step execution.

-

It will not go into standby mode during step execution.

Caution 4.

[Simulator]
You may jump to an interrupt handler during step execution.

Caution 5.

During source-level stepping, the debugger may appear to be executing instructions that are not supposed to be executed.
However, the reason for these problems is a difference between the debugging information generated by the compiler and the actual code. The result of executing the code generated by the compiler is correct.

Example

In the program code shown below, it seems that the position indicated by the current PC might be moved to position (*1) after the execution of (*2), although (*1) is never actually executed in the generated code.

void main(void);
int x, y, z1, z2, z3;
void func(int i)
{
    if (i == 0) {
        ++x; // <-(*1)
        ++z1;++z2;++z3;
    } else {
        ++y; // <-(*2)
        ++z1;++z2;++z3;
    }
}
int one = 1;
void main(void)
{
  while (1)
  {
    func(one);
  }
}

Note that this caution may be eliminated by making either or both of the following settings on the [Compile Options] tab in the Property panel of the build tool.

-

Set the [Enhance debug information with optimization] property to [Yes(-g_line)] in the [Debug Information] category.

-

Set the [Level of optimization] property to [Debug precedence(-Onothing)] in the [Optimization] category.