bpadd - 2022.2 English

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

Document ID
UG1400
Release Date
2023-01-02
Version
2022.2 English

Set a breakpoint/watchpoint.

Syntax

bpadd <options>

Set a software or hardware breakpoint at address, function or <file>:<line>, or set a read/write watchpoint, or set a cross-trigger breakpoint.

Options

Option Description
-addr <breakpoint-address> Specify the address at which the breakpoint should be set.
-file <file-name> Specify the <file-name> in which the breakpoint should be set.
-line <line-number> Specify the <line-number> within the file where the breakpoint should be set.
-type <breakpoint-type> Specify the breakpoint type <breakpoint-type> can be one of the values below: auto = Auto-breakpoint type is chosen by the hw_server/TCF agent. This is the default type. hw = hardware breakpoint. sw = software breakpoint.
-mode <breakpoint-mode> Specify the access mode that will trigger the breakpoint. <breakpoint-mode> can be a bitwise OR of the values below: 0x1 is triggered by a read from the breakpoint location. 0x2 is triggered by a write to the breakpoint location. 0x4 is triggered by an instruction execution at the breakpoint location. This is the default for line and address breakpoints. 0x8 is triggered by a data change (not an explicit write) at the breakpoint location.
-enable <mode> Specify initial enablement state of breakpoint. When <mode> is 0 the breakpoint is disabled, otherwise the breakpoint is enabled. The default is enabled.
-ct-input <list> -ct-output <list> Specify input and output cross triggers. <list> is a list of numbers identifying the cross trigger pin. For Zynq 0-7 it is CTI for core 0, 8-15 is CTI for core 1, 16-23 is CTI ETB and TPIU, and 24-31 is CTI for FTM.
-skip-on-step <value> Specify the trigger behaviour on stepping. This option is only applicable for cross trigger breakpoints and when DBGACK is used as breakpoint input. 0 = trigger every time core is stopped (default). 1 = suppress trigger on stepping over a code breakpoint. 2 = suppress trigger on any kind of stepping.
-properties <dict> Specify advanced breakpoint properties.
-meta-data <dict> Specify metadata of advanced breakpoint properties.
-target-id <id> Specify a target ID for which the breakpoint should be set. A breakpoint can be set for all the targets by specifying the <id> as "all". If this option is not used, the breakpoint is set for the active target selected through targets command. If there is no active target, the breakpoint is set for all targets.

Note(s)

  • Breakpoints can be set in XSDB before connecting to hw_server/TCF agent. If there is an active target when a breakpoint is set, the breakpoint will be enabled only for that active target. If there is no active target, the breakpoint will be enabled for all the targets. The target-id option can be used to set a breakpoint for a specific target, or all targets. An address breakpoint or a file:line breakpoint can also be set without the options -addr, -file, or -line. For address breakpoints, specify the address as an argument, after all other options. For file:line breakpoints, specify the file name and line number in the format <file>:<line>, as an argument, after all other options.

Returns

Breakpoint id or an error if invalid target id is specified.

Examples

bpadd -addr 0x100000

Set a Breakpoint at address 0x100000. Breakpoint type is chosen by hw_server/TCF agent.

bpadd -addr &main

Set a function Breakpoint at main. Breakpoint type is chosen by hw_server/TCF agent.

bpadd -file test.c -line 23 -type hw

Set a hardware breakpoint at test.c:23.

bpadd -target-id all 0x100

Set a breakpoint for all targets, at address 0x100.

bpadd -target-id 2 test.c:23

Set a breakpoint for target 2, at line 23 in test.c.

bpadd -addr &fooVar -type hw -mode 0x3

Set a read/write watchpoint on variable fooVar.

bpadd -ct-input 0 -ct-output 8

Set a cross trigger to stop Zynq core 1 when core 0 stops.