winIDEA SDK
Loading...
Searching...
No Matches
test_set_bp.py
1# This script is licensed under BSD License, see file LICENSE.txt.
2# (c) TASKING Germany GmbH, 2023
3#
4# This Python script sets breakpoints by different methods:
5# directly by symbol name, by file name and line number,
6# and by specific memory address. Additionally, it sets a conditional
7# breakpoint based on a variable value within the function context.
8
9import isystem.connect as ic
10
11
12winidea_id = ''
13
14
15def test_setBP():
16 connMgr = ic.ConnectionMgr()
17 connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
18
19 bpCtrl = ic.CBreakpointController(connMgr)
20 bpCtrl.setBP("main")
21 print("BP at function 'main' is set (via symbol name).")
22
23 bpCtrl.setBP(215, "CORE0/startup.c")
24 print("BP at line 215 in CORE0/startup.c is set (via file name and line number).")
25
26 bpCtrl.setBP(0, 0x20000400)
27 print("BP at address 0x20000400 is set (via memory area and address).")
28
29 bpCtrl.setBP("mainLoopEnd", 0, "mainLoopCounter==42")
30 print("BP with condition at function 'mainLoopEnd' is set.")
31
32
33if __name__ == "__main__":
34 test_setBP()