Running, stopping, and stepping through an application
Arm® Debugger enables you to control the execution of your application by sequentially running, stopping, and stepping at the source or instruction level.
Once you have connected to your target, you can use the options on the stepping toolbar Stepping Toolbar in the Debug Control view to run, interrupt, and step through the application. See Debug Control for more information.
You can also use the Commands view to enter the execution control group of commands to control application execution.
Figure 7-1 Debug Control view
- You must compile your code with debug information to use the source level stepping commands. By default, source level calls to functions with no debug information are stepped over. Use the set step-mode command to change this default setting.
- Be aware that when stepping at the source level, the debugger uses temporary breakpoints to stop execution at the specified location. These temporary breakpoints might require the use of hardware breakpoints, especially when stepping through code in ROM or Flash. If the available hardware breakpoint resources are not enough, then the debugger displays an error message.
- Stepping on multicore targets are dependent on SMP/AMP and debugger settings. See Overview: Debugging multi-core (SMP and AMP), big.LITTLE, and multi-cluster targets for more information.
There are several ways to step through an application. You can choose to step:
Source level or instruction level.
In source level debugging, you step through one line or expression in your source code. For instruction level debugging, you step through one machine instruction. Use the Toggle stepping mode button on the toolbar to switch between source and instruction level debugging modes.
Into, over, or out of all function calls.
If your source is compiled with debug information, using the execution control group of commands, you can step into, step through, or step out of functions.
- Through multiple statements in a single line of source code, for example a
Continue running the application - Click to start or resume execution.
Interrupt running the application - Click to pause execution.
Step through - Click to step through the code.
Step over - Click to step over code.
Step out - Click to continue running to the next line of code after the selected stack frame finishes.
Toggle stepping mode - Click to change the stepping mode between source line and instruction.
To step a specified number of times you must use the Commands view to manually execute one of the stepping commands with a number.
steps 5 # Execute five source statements stepi 5 # Execute five instructions
See Commands view for more information.