User guide

Tutorials
Click Instruction Stepping Mode in the Debug view toolbar to allow single
stepping through the individual assembly instructions. Stepping through assembly
code advances the instruction pointer in the Disassembly view. Because multiple
assembly instructions represent a single line of C/C++ code, the instruction
pointer might not advance in the C/C++ Editor view with each step through the
assembly instructions.
Click Instruction Stepping Mode a second time to return to single stepping
in the Editor view at the C/C++ statement level.
Note: If you do not have the source code for a function, stepping through the code
automatically uses Disassembly view regardless of whether instruction stepping mode
is on or off.
To view stack trace:
The Debug view displays the program execution stack and dynamically updates it as you
step through code. Any time the processor suspends, the Debug view displays the name of
the suspended function, and the sequence of function calls that led up to the current
program counter. This view provides a snapshot of your current position within the
program execution.
Refer to Related Topics
for more information about the Debug view.
To view execution trace:
On the Window menu, point to Show View, and then click Trace. When executing a
program on a Nios II hardware target, the Trace view displays the exact execution trace of
the program running in hardware. This view provides a snapshot of the specific code that
executed to arrive at the current position.
To track variables:
Click the Variables tab in the upper-right pane of the Debug perspective to display the
Variables view. You can also point to Show View on the Window menu, and then click
Variables.
Local Variables
The Variables view automatically displays all variables local to the scope where the
processor is suspended. Use the Variables view to track and change variable values on-
the-fly during a debug session. This is useful to test your program's response to specific
conditions, or to force a loop index to skip over a loop.
The Variables view is context sensitive, depending on the currently selected function in the
Debug view's stack trace display. Selecting different functions allows you to see the
variables (and their current values) defined at each level of the stack trace.
Note: Hovering the mouse over a variable in the source code displays the variable's
value as a tool-tip. This is often the easiest way to see the value of a variable in the
current scope.
To change the value of a variable, right-click the variable name and then click Change
Value.... This opens the Set Value dialog box, which allows you to specify a new value
for the variable.
Global Variables
21