winIDEA SDK
test_set_bp.py
1# This script is licensed under BSD License, see file LICENSE.txt.
2#
3# (c) TASKING Germany GmbH, 2023
4
5import isystem.connect as ic
6
7
8winidea_id = ''
9
10
11def test_setBP():
12 connMgr = ic.ConnectionMgr()
13 connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
14
15 bpCtrl = ic.CBreakpointController(connMgr)
16 bpCtrl.setBP("main")
17 print("BP at function 'main' is set (via symbol name).")
18
19 bpCtrl.setBP(14, "src/main.cpp")
20 print("BP at 'main_loop_counter' is set (via file name and line number).")
21
22 # for STM32 use:
23 bpCtrl.setBP(0, 0x08001F98)
24 # for TC399 use:
25 # bpCtrl.setBP(0, 0xA0080ED8)
26 print("BP at function 'main' is set (via memory area and address).")
27
28 bpCtrl.setBP("get_random", 0, "main_loop_counter==42")
29 print("BP with condition at function 'get_random' is set.")
30
31
32if __name__ == "__main__":
33 test_setBP()