winIDEA SDK
test_get_stack_frame_info.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_getStackFrameInfo():
12 connMgr = ic.ConnectionMgr()
13 connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
14
15 dataCtrl2 = ic.CDataController2(connMgr)
16
17 print("Getting stack data of active frames...")
18 stackData = dataCtrl2.getStackFrameInfo(True, True)
19 try:
20 stackData: ic.IStackFrameInfo
21
22 stackFrames = stackData.StackFrames()
23 stackFrames: ic.IVectorStackFrames
24
25 for index in range(stackFrames.size()):
26 stackFrame = stackFrames.at(index)
27 print(f"Frame {index}:")
28 print(f"\tFile name: {stackFrame.FileName()}")
29 print(f"\tLine number: {stackFrame.LineNumber()}")
30 print(f"\tFunction name: {stackFrame.FunctionName()}")
31 print(f"\tAddress: {stackFrame.Address()}")
32 print(f"\tMemory area: {stackFrame.MemoryArea()}")
33 print(f"\tPartition: {stackFrame.Partition()}")
34 finally:
35 dataCtrl2.release(stackData)
36
37
38if __name__ == "__main__":
39 test_getStackFrameInfo()