1
2
3
4
5
6
7
8import isystem.connect as ic
9
10
11winidea_id = ''
12
13
14def test_waitState():
15 connMgr = ic.ConnectionMgr()
16 connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
17
18 execCtrl = ic.CExecutionController(connMgr)
19 addCtrl = ic.CAddressController(connMgr)
20 bpCtrl = ic.CBreakpointController(connMgr)
21 execCtrl.reset()
22 address = addCtrl.getFunctionAddress("targetInit").getAddress()
23 print(f"Setting BP at function 'target_init': {hex(address)}")
24 bpCtrl.setBP(0, address)
25
26 print(f"Run and use `waitUntilStopped()` with 1 sec timeout...")
27 execCtrl.resetAndRun()
28 execCtrl.waitUntilStopped(1000, isThrow=True)
29 print(f"\tCPU stopped on BP.")
30
31 print(f"Run and use `waitWhileRunning()` with 1 sec timeout...")
32 execCtrl.resetAndRun()
33 execCtrl.waitWhileRunning(1000, isThrow=True)
34 print(f"\tCPU stopped on BP.")
35
36 bpCtrl.deleteAll()
37
38
39if __name__ == "__main__":
40 test_waitState()