Using Vitis Debugger - 2024.1 English

Vitis Model Composer User Guide (UG1483)

Document ID
UG1483
Release Date
2024-05-30
Version
2024.1 English

The Vitis IDE provides a debug environment that can be invoked directly from Vitis Model Composer.

The Vitis IDE debug environment has many features found in traditional GUI-based debug environments, such as GDB. You can add break points to the code, step over or step into specific lines of codes, loops, or functions, and examine the state of variables and force them to specific values.

To invoke the Vitis Debugger from Vitis Model Composer, do the following:

  1. Open the model that contains the C/C++ source code block you would like to debug.
  2. Run vmcLaunchVitisDebugger('name') in the MATLABĀ® Command Window, where name is the name of the model or block you would like to debug.
    Tip: vmcLaunchVitisDebugger(gcs) will open Vitis Debugger for the Simulink model that is currently open. vmcLaunchVitisDebugger(gcb) will open Vitis Debugger for the block that is currently selected.
    After a few moments, the Vitis IDE loads and the following message appears.
    Generated by Your Tool
  3. Select the Debug button on the Vitis IDE menu.


  4. Inside the Debug panel, make sure Attach to PID is select in the drop-down menu. Click Start Debugging.


    Wait for the debugger to finish launching. When finished, the status bar at the bottom of the Vitis window will turn orange and indicate clangd: idle.



  5. In the Vitis Debugger, open the source file you would like to debug. (Select File > Open File...)
  6. On the source code line where you would like the debugger to stop, place a breakpoint by clicking to the left of the line number. A red circle will display when the breakpoint has been successfully placed.


  7. Return to Simulink and run the model.

When model execution hits the breakpoint that you set, the Vitis Debugger will pause execution on that line, which will become highlighted.



You can now use the Debug controls on the left side of the screen to control program execution, view the call stack and data variables, and enable and disable breakpoints. For more information on the capabilities of the Vitis Debugger, refer to Vitis Unified Software Platform Documentation: Embedded Software Development (UG1400).

When finished debugging, click Stop in the Debug panel.