6import isystem.connect
as ic
12def callTarget(connectionMgr, functionName, params, traceCtrl):
14 This function executes function on the target, and also
15 starts trace. Use it instead of CExecutionController.call(),
16 when you have to record trace.
19 connectionMgr - isntance of ConnectionMgr()
20 functionName - name of the function to execute
21 params - values of function parameters, can be empty list: []
22 traceCtrl - analyzer document, which will record trace
24 retValName = "isystem___test_ret_val"
25 paramPrefix =
"isystem___test_param_"
28 ic.CTestCaseController.clearAllTests(cmgr)
30 testCtrl = ic.CTestCaseController(connectionMgr, functionName, retValName)
34 for idx
in range(0, len(params)):
35 parameterName = paramPrefix + str(idx)
36 testCtrl.createParameter(idx, parameterName)
45 parameterName = paramPrefix + str(idx)
46 testCtrl.modify(parameterName, param)
51 testCtrl.waitUntilStopped(0, 50)
53 if testCtrl.getStatus() != ic.IConnectTest.stateEnded:
54 raise Exception(
"Function call didn't finish normally!" +
55 testCtrl.testState2str(testCtrl.getStatus()))
66cmgr = ic.ConnectionMgr()
67cmgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
69debugCtrl = ic.CDebugFacade(cmgr)
75 debugCtrl.runUntilFunction(
"main")
76 debugCtrl.waitUntilStopped()
78print(ic.getModuleVersion())
81traceCtrl = ic.CTraceController(cmgr,
'tracedoc_hw.trd',
'w')
83callTarget(cmgr,
'test_debug', [], traceCtrl)