5import isystem.connect
as ic
12 This function initializes the target. Customize it according to
16 debugCtrl = ic.CDebugFacade(cmgr)
19 debugCtrl.runUntilFunction("main")
20 debugCtrl.waitUntilStopped()
23 debugCtrl.modify(ic.IConnectDebug.fMonitor,
"debug_flag",
"true")
30def printVars(dataCtrl, cvars):
32 print(
' Name: ', cvar.getName())
33 print(
' Type: ', cvar.getType())
34 print(
' Value: ', dataCtrl.evaluate(ic.IConnectDebug.fMonitor, cvar.getName()).getResult())
38def printStackFrame(dataCtrl, stackFrame, partitions):
39 print(
'Address: ', stackFrame.getAddress())
40 print(
'Mem area: ', stackFrame.getMemArea())
41 print(
'File name: ', stackFrame.getFileName())
42 print(
'Line num: ', stackFrame.getLineNumber())
43 print(
'Partition: ', partitions[1][stackFrame.getPartition()])
44 function = stackFrame.getFunction()
45 print(
'Function: ', function.getName())
46 print(
' Scope: ', function.getScope())
47 print(
' Type: ', function.getReturnType())
48 print(
' Module idx: ', function.getModuleIndex())
50 printVars(dataCtrl, function.getParameters())
51 print(
' Local variables:')
52 printVars(dataCtrl, function.getLocalVars())
55cmgr = ic.ConnectionMgr()
56cmgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
57debugCtrl = initTarget(cmgr)
59debugCtrl.setBP(
'test_func1')
61debugCtrl.waitUntilStopped()
65dataCtrl = ic.CDataController2(cmgr)
67stackFrames = ic.StackFrameVector()
68dataCtrl.getStackFrames(
False,
False, stackFrames)
71fileNames = ic.StrVector()
72dataCtrl.getPartitions(paths, fileNames)
74downloadFiles = [list(paths), list(fileNames)]
77for stackFrame
in stackFrames:
78 dataCtrl.setStackFrameContext(0, stackFrameIdx)
79 printStackFrame(dataCtrl, stackFrame, downloadFiles)