User guide
Tutorials
Refer to Related Topics for more information about the Debug view.
If you accidentally terminate the debug session, or the download cable connection is
interrupted, you can easily start a new debugging session by clicking Debug on the
toolbar.
To step through the C/C++ code line by line:
Click Step Into. If executing a line of code that calls a function, the debugger
steps into the function. Otherwise it executes the line of code and suspends on the
next line in the current function. You can also step into a function by pressing F5.
Click Step Over. If executing a line of code that calls a function, the debugger
executes the entire called function and suspends on the next line in the current
function. Otherwise it executes the line of code and suspends on the next line in
the current function. You can also step over a line of code by pressing F6.
Click Step Return. The debugger finishes executing the current function,
returns to the calling function, and suspends on the next line in the calling
function. You can also step return from a function by pressing F7.
To use breakpoints and watchpoints:
You can set breakpoints on specific lines of code, remove breakpoints, or disable them
temporarily. Enabled breakpoints suspend execution when the processor reaches that line
of code.
To set a breakpoint for this example:
1. If the processor is running, select Thread [0] (Running) in the Debug view and
click
Suspend. You can only add breakpoints while the processor is suspended.
2. Click the count_binary.c tab in the editor.
3. On the Edit menu, click Find/Replace....
4. Type count == 0xff in the Find box, then click Find. The editor displays the
appropriate line of code.
5. Click Close in the Find/Replace dialog box.
6. Double-click in the margin next to the line if( count == 0xff ) to set a
breakpoint. You can also right-click the margin and click Toggle Breakpoint. The
breakpoint symbol appears in the margin, as shown below.
19