Debug

About this task

After you click Debug in the Debug Configuration window, the OpenOCD server starts, connects to the target, starts the gdb client, downloads the application, and starts the debugging session. Messages and a list of VexRiscv registers display in the Console. The main.c file opens so you can debug each step.

Procedure

  1. Click the Resume button or press F8 to resume code operation.
  2. Click Step Over (F6) to do a single step over one source instruction.
  3. Click Step Into (F5) to do a single step into the next function called.
  4. Click Step Return (F7) to do a single step out of the current function.
  5. Double-click in the bar to the left of the source code to set a breakpoint. Double-click a breakpoint to remove it.
  6. Click the Registers tab to inspect the processor's registers including the CSR registers.
  7. Click the Memory tab to inspect the memory contents including the Peripheral register monitors.
  8. Click the Suspend button to stop the code operation.
  9. Turn on any peripheral in the Peripheral pane to add the peripheral to the Memory monitor.
  10. When you finish debugging, click Terminate to disconnect the OpenOCD debugger.

Results

Figure 1. Perform Debugging
Notice: For more information on debugging with Eclipse, refer to Running and debugging projects in the Eclipse documentation.