Instead of stepping, you can set breakpoints to suspended the application at a certain point.
A breakpoint is set on an executable line of a program. If a breakpoint is enabled during debugging, the execution suspends before that line of code executes.
To add a breakpoint:
Double-click the marker bar located in the left margin of the C/C++ Editor next to the line of code where you want to add a breakpoint.
A dot is displayed in the marker bar and in the Breakpoints view, along with the name of the associated file. When the breakpoint is actually set, a check mark
appears in front of the dot.
You can disable a breakpoint or completely remove it. To disable a breakpoint, do one of the following:
In the Breakpoints view, disable a breakpoint by clearing the check box.
In the Editor view, right-click on a breakpoint dot in the margin and select Disable Breakpoint.
The blue breakpoint dot turns white.
To completely remove the breakpoint, do one of the following:
In the Breakpoints view, right-click on a breakpoint and select Remove.
In the Editor view, right-click on a breakpoint dot in the margin and select Toggle Breakpoint.
In the Editor view, double-click on a breakpoint.
The blue breakpoint dot disappears.
With the techniques described above:
Set a line breakpoint on the code line printf( "a small %dst\n",i-3 );
.
Clear the FSS view.
Restart your application.
The application suspends when entering the main() function because this was defined in the Debug configuration.
To resume execution, from the Debug menu, select Resume, or press F8, or click on the Resume button ().
The application suspends execution, before this line is executed. The FSS view now shows:
1 2 3 Hello world, this is
Resume execution again to finish execution.
Note that though the application has finished execution, it has not been terminated yet. Your debug session is still active.
Copyright © 2024 TASKING B.V.