Debug an Application Already Running On a Target Device - 2022.1 English

Vitis Unified Software Platform Documentation: Embedded Software Development (UG1400)

Document ID
Release Date
2022.1 English
Xilinx System debugger allows users to debug an application that is already running on the target device. For example, a baremetal application, or Linux kernel booting from a flash device can be debugged using System debugger. Below are the steps for attaching to an application running on the target.
Note: Debugger does not modify the state of the processors on the target device, but merely connects to them. Users can halt the processors, and debug from the current PC.
  1. Create a target connection to the host to where the hardware board is connected. If the hardware board is connected to the same machine where the Vitis IDE is running, this step can be skipped. In the subsequent steps which refer to remote board and remote connection, the default Local connection can be used.
    1. Start hw_server on the remote machine where the board is connected.
    2. Open Target Connections by searching for it through the search button on top right corner of Vitis IDE.

    3. Create a new target connection and enter the remote machine name and port number.

  2. In Attach to running target mode, launch system debugger.
    1. In task bar, click the debug button, and then select Debug Configurations.

    2. In the Debug Configurations dialog box, create a new debug configuration by double-clicking Single Application Debug.

    3. In the Main tab of the Debug Configurations dialog box, ensure that connection is set to the new connection created for the remote board and click on debug. This should connect the debugger to remote board and open the debug view.

  3. Add symbol files to enable source level debug. The debugger does not know which code is running on the target, and it can only show assembly code until users tell the debugger which ELF to use for mapping the assembly code to source. To do this, add the ELF as a symbol file.
    1. Right-click on a processor, and then select Symbol Files.

    2. In the Symbol Files dialog box, click Add, and then add the ELF that is running on the target. After this is done, debugger will extract debug info from the ELF and map it to the source code. The debug view should now be updated to show the source code corresponding to the current PC.

    3. If needed, set up path mapping (described in Set Up Path Mapping).