82 AVR2070 8240B-AVR-06/09
Figure D-3-16 Debugging Tools
The “Variables” section contains all local variables for the current function. To add a
global variable press the “Add Global Variable” button. It has the eyeglasses above a
globe:
Figure D-3-17 Debug Watch Variables
Additionally variables can be added by the “Expressions” tab. To open this Go to the
“Window/Show View/Expressions” option. Add a variable by right-clicking and
pressing “add watch expression”, then writing in the variable name. This is useful for
static variables which do not appear in the global variable list:
Figure D-3-18 Debug Watch Expressions
To switch between the Debug perspective and the C/C++ perspective hit the “Debug”
or “C/C++” button in the top-right corner. This does not stop the debug operation, but
makes it easier to navigate the project by opening the C/C++ perspective:
Figure D-3-19 Debug Perspective Tab
It is also important to remember the restriction about two breakpoints. This includes
breakpoints used by GDB – for example stepping over a function uses one
breakpoint. This leaves only one user-available breakpoint while inside the function. If
more breakpoints are set than are available, an error will be thrown when a RUN
command is attempted. To correct this remove or disable any breakpoints that are not
immediately needed.
When debugging is finished, be sure to hit the “STOP” button to disconnect the
debugger. If an attempt is made to start a new debugging session while an old
debugging session is connected, it will result in a number of errors. To correct this
switch to the debug perspective, then right click on a debugging session and choose
the “terminate all” option. Then re-launch the debugger: