User guide

Nios II IDE Help System
You can also selectively display global variables, which are variables defined outside the
scope of all functions, but are available from within any function. In the count_binary.c
example, to track the global variable count in the Variables view, do the following:
1. If the processor is running, click Thread [0] (Running) in the Debug view, and
click
Suspend.
2. Right-click in the Variables view and then click
Add Global Variables..., or
click
Add Global Variables on the Variables view toolbar.
3. Scroll down and turn on count.
4. Click OK. The variable count and its current value appears in the Variables view.
Because count is declared as a char type, it displays in ASCII format by default in
the Variables view.
Now, every time execution suspends, the Variables view displays the value for the variable
count.
Variables Display Format
You can change the display format of variable values appearing in the Variables view in
two ways. For example, to change the display format of a single variable to hexadecimal,
do the following:
Right-click the variable, point to Format, and then click Hexadecimal. The
format of the value changes.
To change the display format of all variables to hexadecimal, do the following:
1. On the Window menu, click Preferences.
2. Expand C/C++, Debug.
3. Select Hexadecimal in the Default variable format list.
4. Click OK.
The format of the values for local variables changes the next time you resume
execution. The format of the values for global variables changes the next time you restart
the debug session.
Refer to Related Topics
for more information about variables.
To track watch expressions:
Click the Expressions tab in the upper-right pane of the Debug perspective to display the
Expressions view. You can also point to Show View on the Window menu, and then click
Expressions. This view displays user-specified C expressions evaluated at the current
scope. When the processor suspends, the Expressions view evaluates each of the
expressions, and displays the value.
In the count_binary.c example, to track the arbitrary expression count==5 in the
Expressions view, do the following:
1. If necessary, use a breakpoint to stop execution on the line if( count == 0xff
), as described in the breakpoints
section of this topic.
22