14.28 Trace Window

Open the Trace window by selecting Window > Debugging > Trace. You must be in debug mode to see trace data.

Tracing allows you to record the step-by-step execution of your code and examine this recording in the Trace window. Trace is currently available for the following tools:

  • Simulator
  • MPLAB ICE 4 in-circuit emulator
  • MPLAB REAL ICE in-circuit emulator (legacy tool)

Right clicking on a trace column in the window will pop up the context menu (first table). Depending on the tool you are using, you may or may not see all menu items.

Dialogs associated with trace are defined in the second table.

Table 14-102. Trace Window Context Menu
Menu ItemDescription
Symbolic ModeFor the Instruction column, toggle between displaying literal register addresses (e.g., 0x5) and symbolic register macros (e.g., PORTA).
Go ToOpens a Go To dialog.

Trigger: move to the trigger line (0).

Top: move to the top trace line.

Bottom: move to the bottom trace line.

Trace Line: specifies and goes to a trace line location.

Go To Source LineSelects a trace line and then selects this option to go to the corresponding line in source code.
Display TimeFor the Cycle column (will display if not previously visible):

As Hex Cycle Count: displays cycle count as hexadecimal.

As Decimal Cycle Count: displays cycle count as decimal.

In Seconds Elapsed: displays cycle count in seconds elapsed.

In Engineering Format: displays cycle count in the appropriate engineering format (powers of 103).

Clear Trace FileClears the data in the trace display.
FindFinds items in trace display.

Opens a Find dialog.

Output To FileSaves the trace data to a file.

Opens Define Range dialog, which opens a Save dialog.

PrintPrint the data.

Opens a Print dialog.

Adjust Table ColumnsAdjusts the columns in the trace display to fit the data automatically.
Reload ViewReloads the original data view for the trace display at pause.
Table 14-103. Trace Dialogs
DialogDescription
Go ToSpecifies a trace line to go to.
FindFinds a line number or other data in the trace display.
Output to File RangeSpecifies a range of lines to output to a file.

Click OK to proceed to the Save dialog to save the data to a text file.

SaveSaves data to a text file.
PrintSpecifies the printer, page setup, and appearance before printing.