Usage Examples - Usage Examples - 2026.1 English - UG1702

Vitis Reference Guide (UG1702)

Document ID
UG1702
Release Date
2026-06-23
Version
2026.1 English

Debug Operations on Session Object

In this mode, you can create a session object and run debug operations on different debug targets using the same session object.

session=start_debug_session()
session.connect(url="TCP:xhdbfarmrkd11:3121")
session.targets(3)
# All subsequent commands are run on target 3, until the target is changed with targets() function
session.dow("test.elf")
session.bpadd(addr='main')
session.con()
session.targets(4)
# All subsequent commands are run on target 4
session.dow("foo.elf")
session.bpadd(addr='foo')
session.con()

Debug Operations on Target Object

Use the Target object returned by the targets() function to run debug operations. The following is an example:

session = start_debug_session()
session.connect(url="TCP:xhdbfarmrkd11:3121")
ta3 = session.targets(3)
ta4 = session.targets(4)
# Run debug commands using target objects
ta3.dow("test.elf")
ta4.dow("foo.elf")
bp1 = ta3.bpadd(addr='main')
bp2 = ta4.bpadd(addr='foo')
ta3.con()
ta4.con()
...
bp1.status()
bp2.status()

For interactive use, use commands and options instead of functions, which require more typing. The xsdb interactive() function supports these commands, as shown below.

Vitis-ng [1]: import xsdb
Vitis-ng [2]: xsdb.interactive()
% conn -host xhdbfarmrkb9
tcfchan#0
% ta
1 APU 
    2 ARM Cortex-A9 MPCore #0 (Running) 
    3 ARM Cortex-A9 MPCore #1 (Running)
4 xc7z020
% ta 2
<xsdpy._target.Target object at 0x7fb2652d3520>
% stop
Info: ARM Cortex-A9 MPCore #0 (target 2) Stopped at 0xffffff28 (Suspended)
% q
Vitis-ng [3]: