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.
- 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.
- Start hw_server on the remote machine where the board is connected.
- Open Target
Connections by searching for it through the search
button on top right corner of Vitis
IDE.
- Create a new target connection and enter the remote
machine name and port number.
- In Attach to running
target mode, launch system debugger.
- In task bar, click the debug button, and then select Debug
Configurations.
- In the Debug Configurations
dialog box, create a new debug configuration by double-clicking
Single Application
Debug.
- 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.
- In task bar, click the debug button, and then select Debug
Configurations.
- 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.
- Right-click on a processor, and then select Symbol Files.
- 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.
- If needed, set up path mapping (described in Set Up Path Mapping).
- Right-click on a processor, and then select Symbol Files.